Update net.nim - fix #2193
Fixes number #2193 and resolves some ambiguity issues
This commit is contained in:
parent
a853d9c3e3
commit
ef44fd344b
1 changed files with 5 additions and 2 deletions
|
|
@ -15,6 +15,9 @@ export Port, `$`, `==`
|
||||||
|
|
||||||
const useWinVersion = defined(Windows) or defined(nimdoc)
|
const useWinVersion = defined(Windows) or defined(nimdoc)
|
||||||
|
|
||||||
|
when useWinVersion:
|
||||||
|
import winlean
|
||||||
|
|
||||||
when defined(ssl):
|
when defined(ssl):
|
||||||
import openssl
|
import openssl
|
||||||
|
|
||||||
|
|
@ -304,7 +307,8 @@ proc listen*(socket: Socket, backlog = SOMAXCONN) {.tags: [ReadIOEffect].} =
|
||||||
## queue of pending connections.
|
## queue of pending connections.
|
||||||
##
|
##
|
||||||
## Raises an EOS error upon failure.
|
## 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 = "") {.
|
proc bindAddr*(socket: Socket, port = Port(0), address = "") {.
|
||||||
tags: [ReadIOEffect].} =
|
tags: [ReadIOEffect].} =
|
||||||
|
|
@ -738,7 +742,6 @@ proc peekChar(socket: Socket, c: var char): int {.tags: [ReadIOEffect].} =
|
||||||
return
|
return
|
||||||
result = recv(socket.fd, addr(c), 1, MSG_PEEK)
|
result = recv(socket.fd, addr(c), 1, MSG_PEEK)
|
||||||
|
|
||||||
import winlean
|
|
||||||
proc readLine*(socket: Socket, line: var TaintedString, timeout = -1,
|
proc readLine*(socket: Socket, line: var TaintedString, timeout = -1,
|
||||||
flags = {SocketFlag.SafeDisconn}) {.
|
flags = {SocketFlag.SafeDisconn}) {.
|
||||||
tags: [ReadIOEffect, TimeEffect].} =
|
tags: [ReadIOEffect, TimeEffect].} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue