Add checks for invalid socket when creating sockets.
This commit is contained in:
parent
817337af30
commit
21d0cc8cdf
7 changed files with 9 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ proc serve*(action: proc (){.nimcall.}) =
|
|||
of "tcp", "":
|
||||
when useCaas:
|
||||
var server = socket()
|
||||
if server == invalidSocket: osError(osLastError())
|
||||
let p = getConfigVar("server.port")
|
||||
let port = if p.len > 0: parseInt(p).TPort else: 6000.TPort
|
||||
server.bindAddr(port, getConfigVar("server.address"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue