Implemented buffering for asynchronous sockets.
This commit is contained in:
parent
ed0736d73d
commit
3612aca5fe
3 changed files with 38 additions and 4 deletions
|
|
@ -381,8 +381,8 @@ when defined(windows) or defined(nimdoc):
|
|||
let err = osLastError()
|
||||
if err.int32 != ERROR_IO_PENDING:
|
||||
dealloc dataBuf.buf
|
||||
retFuture.fail(newException(EOS, osErrorMsg(err)))
|
||||
dealloc(ol)
|
||||
retFuture.fail(newException(EOS, osErrorMsg(err)))
|
||||
elif ret == 0 and bytesReceived == 0 and dataBuf.buf[0] == '\0':
|
||||
# We have to ensure that the buffer is empty because WSARecv will tell
|
||||
# us immediatelly when it was disconnected, even when there is still
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue