parent
25cd8a5490
commit
02b9af2f75
9 changed files with 613 additions and 11 deletions
|
|
@ -28,7 +28,7 @@ proc saveReceivedPort(port: int) =
|
|||
|
||||
proc prepareAddress(intaddr: uint32, intport: uint16): ptr Sockaddr_in =
|
||||
result = cast[ptr Sockaddr_in](alloc0(sizeof(Sockaddr_in)))
|
||||
result.sin_family = toInt(nativesockets.AF_INET).uint16
|
||||
result.sin_family = typeof(result.sin_family)(toInt(nativesockets.AF_INET))
|
||||
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