diff options
Diffstat (limited to 'lib/pure/net.nim')
-rw-r--r-- | lib/pure/net.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index af9eea51a..2d1ca8a59 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -1664,6 +1664,9 @@ proc connect*(socket: Socket, address: string, port = Port(0), if selectWrite(s, timeout) != 1: raise newException(TimeoutError, "Call to 'connect' timed out.") else: + let res = getSockOptInt(socket.fd, SOL_SOCKET, SO_ERROR) + if res != 0: + raiseOSError(OSErrorCode(res)) when defineSsl and not defined(nimdoc): if socket.isSSL: socket.fd.setBlocking(true) |