Fix connect issues

This should fix the connect issues people were reporting by ensuring connect is only called once per socket. I also updated the send method because there was a potential error there too.