diff options
author | Varriount <Varriount@users.noreply.github.com> | 2015-02-21 15:12:57 -0500 |
---|---|---|
committer | Varriount <Varriount@users.noreply.github.com> | 2015-02-21 15:12:57 -0500 |
commit | ef44fd344bcaa2083766448c0974d4ffe3c09c33 (patch) | |
tree | 98b523740e8fa74b7f23f2f3d525b69c52680831 /lib | |
parent | a853d9c3e3a65042a3fa75c021676e22edf13269 (diff) | |
download | Nim-ef44fd344bcaa2083766448c0974d4ffe3c09c33.tar.gz |
Update net.nim - fix #2193
Fixes number #2193 and resolves some ambiguity issues
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/net.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index f42010f1a..18297eb89 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -15,6 +15,9 @@ export Port, `$`, `==` const useWinVersion = defined(Windows) or defined(nimdoc) +when useWinVersion: + import winlean + when defined(ssl): import openssl @@ -304,7 +307,8 @@ proc listen*(socket: Socket, backlog = SOMAXCONN) {.tags: [ReadIOEffect].} = ## queue of pending connections. ## ## Raises an EOS error upon failure. - if listen(socket.fd, backlog) < 0'i32: raiseOSError(osLastError()) + if rawsockets.listen(socket.fd, backlog) < 0'i32: + raiseOSError(osLastError()) proc bindAddr*(socket: Socket, port = Port(0), address = "") {. tags: [ReadIOEffect].} = @@ -738,7 +742,6 @@ proc peekChar(socket: Socket, c: var char): int {.tags: [ReadIOEffect].} = return result = recv(socket.fd, addr(c), 1, MSG_PEEK) -import winlean proc readLine*(socket: Socket, line: var TaintedString, timeout = -1, flags = {SocketFlag.SafeDisconn}) {. tags: [ReadIOEffect, TimeEffect].} = |