Implement SO_REUSEADDR for asyncnet and asynchttpserver.

This commit is contained in:
Dominik Picheta 2014-11-07 14:48:11 +00:00
commit 13e3c0d5bb
3 changed files with 20 additions and 2 deletions

View file

@ -428,7 +428,8 @@ proc close*(socket: Socket) =
elif res != 1:
socketError(socket)
proc toCInt(opt: SOBool): cint =
proc toCInt*(opt: SOBool): cint =
## Converts a ``SOBool`` into its Socket Option cint representation.
case opt
of OptAcceptConn: SO_ACCEPTCONN
of OptBroadcast: SO_BROADCAST