summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2014-04-15 13:51:25 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2014-04-15 13:51:25 +0100
commit21d0cc8cdf432b0eaf0bd6ea16d00070ab9dab89 (patch)
treeb7a54e0ca35c336dce49f259b1f40b50a024b9be /compiler
parent817337af304b8cdf8b96754ae039044840333a02 (diff)
downloadNim-21d0cc8cdf432b0eaf0bd6ea16d00070ab9dab89.tar.gz
Add checks for invalid socket when creating sockets.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/service.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/service.nim b/compiler/service.nim
index 42c4aa9f4..2b861e1c7 100644
--- a/compiler/service.nim
+++ b/compiler/service.nim
@@ -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"))