parent
a892d519a6
commit
a27429304e
14 changed files with 61 additions and 71 deletions
|
|
@ -29,10 +29,7 @@ proc saveReceivedPort(port: int) =
|
|||
|
||||
proc prepareAddress(intaddr: uint32, intport: uint16): ptr Sockaddr_in =
|
||||
result = cast[ptr Sockaddr_in](alloc0(sizeof(Sockaddr_in)))
|
||||
when defined(windows):
|
||||
result.sin_family = toInt(nativesockets.AF_INET).int16
|
||||
else:
|
||||
result.sin_family = toInt(nativesockets.AF_INET)
|
||||
result.sin_family = toInt(nativesockets.AF_INET).uint16
|
||||
result.sin_port = nativesockets.htons(intport)
|
||||
result.sin_addr.s_addr = nativesockets.htonl(intaddr)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue