fix: socket import and connected() method when connection isn't yet created
Merge pull request #3 from capensis/master

Bug fixes and missing import