diff options
Diffstat (limited to 'lib/pure/net.nim')
-rw-r--r-- | lib/pure/net.nim | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 3699835c2..7f6783358 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -191,31 +191,6 @@ proc isDisconnectionError*(flags: set[SocketFlag], SocketFlag.SafeDisconn in flags and lastError.int32 in {ECONNRESET, EPIPE, ENETRESET} -proc checkCloseError*(ret: cint) = - ## Asserts that the return value of close() or closeSocket() syscall - ## does not indicate a programming error (such as invalid descriptor). - ## This must only be used when an error has already occurred and - ## you are performing a cleanup. - ## Otherwise, error handling must be performed as usual. - ## - ## This procedure must be called right after perfoming the syscall. Example: - ## - ## .. code-block:: nim - ## - ## let ret = someSysCall() - ## if ret != 0: - ## let errcode = osLastError() - ## checkCloseError sock.closeSocket() - ## raise newException(OSError, osErrorMsg(errcode)) - - if ret != 0: - let errcode = osLastError() - when useWinVersion: - doAssert(errcode.int32 notin {WSANOTINITIALISED, WSAENOTSOCK, - WSAEINPROGRESS, WSAEINTR, WSAEWOULDBLOCK}) - else: - doAssert(errcode.int32 notin {EBADF}) - proc toOSFlags*(socketFlags: set[SocketFlag]): cint = ## Converts the flags into the underlying OS representation. for f in socketFlags: |