parent
d24b6667c6
commit
1a2351f95f
7 changed files with 76 additions and 19 deletions
|
|
@ -221,7 +221,7 @@ proc newSocket*(domain, sockType, protocol: cint, buffered = true): Socket =
|
|||
## Creates a new socket.
|
||||
##
|
||||
## If an error occurs EOS will be raised.
|
||||
let fd = newNativeSocket(domain, sockType, protocol)
|
||||
let fd = createNativeSocket(domain, sockType, protocol)
|
||||
if fd == osInvalidSocket:
|
||||
raiseOSError(osLastError())
|
||||
result = newSocket(fd, domain.Domain, sockType.SockType, protocol.Protocol,
|
||||
|
|
@ -232,7 +232,7 @@ proc newSocket*(domain: Domain = AF_INET, sockType: SockType = SOCK_STREAM,
|
|||
## Creates a new socket.
|
||||
##
|
||||
## If an error occurs EOS will be raised.
|
||||
let fd = newNativeSocket(domain, sockType, protocol)
|
||||
let fd = createNativeSocket(domain, sockType, protocol)
|
||||
if fd == osInvalidSocket:
|
||||
raiseOSError(osLastError())
|
||||
result = newSocket(fd, domain, sockType, protocol, buffered)
|
||||
|
|
@ -1544,7 +1544,7 @@ proc dial*(address: string, port: Port,
|
|||
domain = domainOpt.unsafeGet()
|
||||
lastFd = fdPerDomain[ord(domain)]
|
||||
if lastFd == osInvalidSocket:
|
||||
lastFd = newNativeSocket(domain, sockType, protocol)
|
||||
lastFd = createNativeSocket(domain, sockType, protocol)
|
||||
if lastFd == osInvalidSocket:
|
||||
# we always raise if socket creation failed, because it means a
|
||||
# network system problem (e.g. not enough FDs), and not an unreachable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue