Resolve bugs based on unreliable bytesReceived value.
This commit is contained in:
parent
6e6c15081d
commit
6fa6fdeb34
2 changed files with 21 additions and 53 deletions
|
|
@ -759,6 +759,7 @@ const
|
|||
WSAENETRESET* = 10052
|
||||
WSAETIMEDOUT* = 10060
|
||||
ERROR_NETNAME_DELETED* = 64
|
||||
STATUS_PENDING* = 0x103
|
||||
|
||||
proc createIoCompletionPort*(FileHandle: Handle, ExistingCompletionPort: Handle,
|
||||
CompletionKey: ULONG_PTR,
|
||||
|
|
@ -775,6 +776,12 @@ proc getOverlappedResult*(hFile: Handle, lpOverlapped: POVERLAPPED,
|
|||
lpNumberOfBytesTransferred: var DWORD, bWait: WINBOOL): WINBOOL{.
|
||||
stdcall, dynlib: "kernel32", importc: "GetOverlappedResult".}
|
||||
|
||||
# this is copy of HasOverlappedIoCompleted() macro from <winbase.h>
|
||||
# because we have declared own OVERLAPPED structure with member names not
|
||||
# compatible with original names.
|
||||
template hasOverlappedIoCompleted*(lpOverlapped): bool =
|
||||
(cast[uint](lpOverlapped.internal) != STATUS_PENDING)
|
||||
|
||||
const
|
||||
IOC_OUT* = 0x40000000
|
||||
IOC_IN* = 0x80000000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue