Implements getPeerAddr/getPeerName on Windows and adds IDX.
This commit is contained in:
parent
01c99ff258
commit
4da5e47414
3 changed files with 17 additions and 3 deletions
|
|
@ -534,11 +534,15 @@ proc getSockOpt*(socket: Socket, opt: SOBool, level = SOL_SOCKET): bool {.
|
|||
result = res != 0
|
||||
|
||||
proc getLocalAddr*(socket: Socket): (string, Port) =
|
||||
## Get the socket's local address and port number
|
||||
## Get the socket's local address and port number.
|
||||
##
|
||||
## This is high-level interface for `getsockname`:idx:.
|
||||
getLocalAddr(socket.fd, socket.domain)
|
||||
|
||||
proc getPeerAddr*(socket: Socket): (string, Port) =
|
||||
## Get the socket's peer address and port number
|
||||
## Get the socket's peer address and port number.
|
||||
##
|
||||
## This is high-level interface for `getpeername`:idx:.
|
||||
getPeerAddr(socket.fd, socket.domain)
|
||||
|
||||
proc setSockOpt*(socket: Socket, opt: SOBool, value: bool, level = SOL_SOCKET) {.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue