Define ports as uint16s to fix #3484
This commit is contained in:
parent
a88584dde1
commit
5a582a0d9c
6 changed files with 74 additions and 26 deletions
|
|
@ -45,7 +45,7 @@ proc createServer(port: TPort) {.async.} =
|
|||
name.sin_family = toInt(AF_INET).int16
|
||||
else:
|
||||
name.sin_family = toInt(AF_INET)
|
||||
name.sin_port = htons(int16(port))
|
||||
name.sin_port = htons(uint16(port))
|
||||
name.sin_addr.s_addr = htonl(INADDR_ANY)
|
||||
if bindAddr(server.SocketHandle, cast[ptr SockAddr](addr(name)),
|
||||
sizeof(name).Socklen) < 0'i32:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue