Add SO_REUSEPORT support

This commit is contained in:
Federico Ceratto 2015-12-15 23:50:28 +00:00
commit e174aa1dbc
4 changed files with 10 additions and 3 deletions

View file

@ -72,7 +72,7 @@ type
SOBool* = enum ## Boolean socket options.
OptAcceptConn, OptBroadcast, OptDebug, OptDontRoute, OptKeepAlive,
OptOOBInline, OptReuseAddr
OptOOBInline, OptReuseAddr, OptReusePort
ReadLineResult* = enum ## result for readLineAsync
ReadFullLine, ReadPartialLine, ReadDisconnected, ReadNone
@ -523,6 +523,7 @@ proc toCInt*(opt: SOBool): cint =
of OptKeepAlive: SO_KEEPALIVE
of OptOOBInline: SO_OOBINLINE
of OptReuseAddr: SO_REUSEADDR
of OptReusePort: SO_REUSEPORT
proc getSockOpt*(socket: Socket, opt: SOBool, level = SOL_SOCKET): bool {.
tags: [ReadIOEffect].} =