Allow existing Socket object to be injected.
Merge pull request #388 from bantu/inject-socket-object

Allow existing Socket object to be injected.