diff --git a/asyncdispatch2.nimble b/asyncdispatch2.nimble index 8cc818c5..d5d7a93a 100644 --- a/asyncdispatch2.nimble +++ b/asyncdispatch2.nimble @@ -3,7 +3,7 @@ version = "2.0.1" author = "Status Research & Development GmbH" description = "Asyncdispatch2" license = "Apache License 2.0 or MIT" -skipDirs = @["tests", "Nim", "nim"] +skipDirs = @["tests", "Nim", "nim", "benchmarks"] ### Dependencies diff --git a/asyncdispatch2/transports/datagram.nim b/asyncdispatch2/transports/datagram.nim index 6e4e25e2..d721c536 100644 --- a/asyncdispatch2/transports/datagram.nim +++ b/asyncdispatch2/transports/datagram.nim @@ -141,7 +141,7 @@ when defined(windows): transp.state.incl({ReadEof, ReadPaused}) fromSockAddr(transp.raddr, transp.ralen, raddr.address, raddr.port) transp.buflen = bytesCount - discard transp.function(transp, raddr) + asyncCheck transp.function(transp, raddr) elif int(err) == ERROR_OPERATION_ABORTED: # CancelIO() interrupt transp.state.incl(ReadPaused) @@ -150,7 +150,7 @@ when defined(windows): transp.setReadError(err) transp.state.incl(ReadPaused) transp.buflen = 0 - discard transp.function(transp, raddr) + asyncCheck transp.function(transp, raddr) else: ## Initiation if transp.state * {ReadEof, ReadClosed, ReadError} == {}: @@ -180,7 +180,7 @@ when defined(windows): transp.state.incl(ReadPaused) transp.setReadError(err) transp.buflen = 0 - discard transp.function(transp, raddr) + asyncCheck transp.function(transp, raddr) break proc resumeRead(transp: DatagramTransport) {.inline.} = @@ -330,7 +330,7 @@ else: if res >= 0: fromSockAddr(transp.raddr, transp.ralen, raddr.address, raddr.port) transp.buflen = res - discard transp.function(transp, raddr) + asyncCheck transp.function(transp, raddr) else: let err = osLastError() if int(err) == EINTR: @@ -338,7 +338,7 @@ else: else: transp.buflen = 0 transp.setReadError(err) - discard transp.function(transp, raddr) + asyncCheck transp.function(transp, raddr) break proc writeDatagramLoop(udata: pointer) = diff --git a/asyncdispatch2/transports/stream.nim b/asyncdispatch2/transports/stream.nim index bfabd554..0882833c 100644 --- a/asyncdispatch2/transports/stream.nim +++ b/asyncdispatch2/transports/stream.nim @@ -469,16 +469,14 @@ when defined(windows): else: if not isNil(server.init): var transp = server.init(server, server.asock) - discard server.function( - server, - newStreamSocketTransport(server.asock, server.bufferSize, - transp) - ) + let ntransp = newStreamSocketTransport(server.asock, + server.bufferSize, + transp) + asyncCheck server.function(server, ntransp) else: - discard server.function( - server, - newStreamSocketTransport(server.asock, server.bufferSize, nil) - ) + let ntransp = newStreamSocketTransport(server.asock, + server.bufferSize, nil) + asyncCheck server.function(server, ntransp) elif int32(ovl.data.errCode) == ERROR_OPERATION_ABORTED: # CancelIO() interrupt server.asock.closeAsyncSocket() @@ -713,10 +711,10 @@ else: if sock != asyncInvalidSocket: if not isNil(server.init): var transp = server.init(server, sock) - discard server.function(server, + asyncCheck server.function(server, newStreamSocketTransport(sock, server.bufferSize, transp)) else: - discard server.function(server, + asyncCheck server.function(server, newStreamSocketTransport(sock, server.bufferSize, nil)) break else: