check the socket is connected or not when socket is going to connect. #699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
use case:
when i used socks module as proxy to visit imap.gmail.com, the SocksClient already connected. So, i got the error like this:
error: { Error: connect EISCONN 64.233.187.109:993 - Local (10.0.2.6:56125)
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at internalConnect (net.js:971:16)
at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1106:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
code: 'EISCONN',
errno: 'EISCONN',
syscall: 'connect',
address: '64.233.187.109',
port: 993,
source: 'socket' }
I think when the socket is connected, we should not connect it again.