Convert *_family fields to cushort

Fixes #9008
This commit is contained in:
LemonBoy 2018-09-19 09:24:30 +02:00
commit a27429304e
14 changed files with 61 additions and 71 deletions

View file

@ -41,10 +41,7 @@ proc createServer(port: Port) {.async.} =
var server = newAsyncNativeSocket()
block:
var name: Sockaddr_in
when defined(windows):
name.sin_family = toInt(AF_INET).int16
else:
name.sin_family = toInt(AF_INET)
name.sin_family = toInt(AF_INET).uint16
name.sin_port = htons(uint16(port))
name.sin_addr.s_addr = htonl(INADDR_ANY)
if bindAddr(server.SocketHandle, cast[ptr SockAddr](addr(name)),