From 00fafd1dbe72e3f6c50f981d286e0c753207bc99 Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Mon, 27 Apr 2015 10:25:45 +0500 Subject: [PATCH] Fixed a few socket things --- compiler/nimsuggest/nimsuggest.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/nimsuggest/nimsuggest.nim b/compiler/nimsuggest/nimsuggest.nim index 9f672d49b..4e4925fb8 100644 --- a/compiler/nimsuggest/nimsuggest.nim +++ b/compiler/nimsuggest/nimsuggest.nim @@ -9,7 +9,7 @@ ## Nimsuggest is a tool that helps to give editors IDE like capabilities. -import strutils, os, parseopt, parseutils, sequtils +import strutils, os, parseopt, parseutils, sequtils, net import options, commands, modules, sem, passes, passaux, msgs, nimconf, extccomp, condsyms, lists, net, rdstdin, sexp, suggest, ast @@ -131,7 +131,7 @@ proc returnEPC(socket: var Socket, uid: string, s: SexpNode, return_symbol = "re socket.close() proc findEPCPort(): int = - 98294 # guaranteed to be random + 55822 # guaranteed to be random proc parseCmdLine(cmd: string) = template toggle(sw) = @@ -200,9 +200,8 @@ proc serve() = stdoutSocket.close() of mepc: let port = findEPCPort() - echo(port) var server = newSocket() - server.bindaddr(port.Port, "localhost") + server.bindaddr(Port(port), "localhost") var inp = "".TaintedString server.listen() echo(port)