Fixed a few socket things
This commit is contained in:
parent
53bc541666
commit
00fafd1dbe
1 changed files with 3 additions and 4 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
## Nimsuggest is a tool that helps to give editors IDE like capabilities.
|
## 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,
|
import options, commands, modules, sem, passes, passaux, msgs, nimconf,
|
||||||
extccomp, condsyms, lists, net, rdstdin, sexp, suggest, ast
|
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()
|
socket.close()
|
||||||
|
|
||||||
proc findEPCPort(): int =
|
proc findEPCPort(): int =
|
||||||
98294 # guaranteed to be random
|
55822 # guaranteed to be random
|
||||||
|
|
||||||
proc parseCmdLine(cmd: string) =
|
proc parseCmdLine(cmd: string) =
|
||||||
template toggle(sw) =
|
template toggle(sw) =
|
||||||
|
|
@ -200,9 +200,8 @@ proc serve() =
|
||||||
stdoutSocket.close()
|
stdoutSocket.close()
|
||||||
of mepc:
|
of mepc:
|
||||||
let port = findEPCPort()
|
let port = findEPCPort()
|
||||||
echo(port)
|
|
||||||
var server = newSocket()
|
var server = newSocket()
|
||||||
server.bindaddr(port.Port, "localhost")
|
server.bindaddr(Port(port), "localhost")
|
||||||
var inp = "".TaintedString
|
var inp = "".TaintedString
|
||||||
server.listen()
|
server.listen()
|
||||||
echo(port)
|
echo(port)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue