A bit more connection stuff, still not fully functionel

Signed-off-by: mktange <mktange@gmail.com>