Fixes NimSuggest's socket mode.
This commit is contained in:
parent
fcce536ea0
commit
4ab0cf20fe
1 changed files with 7 additions and 3 deletions
|
|
@ -120,13 +120,17 @@ proc serve() =
|
||||||
server.bindAddr(gPort, gAddress)
|
server.bindAddr(gPort, gAddress)
|
||||||
var inp = "".TaintedString
|
var inp = "".TaintedString
|
||||||
server.listen()
|
server.listen()
|
||||||
|
|
||||||
|
while true:
|
||||||
var stdoutSocket = newSocket()
|
var stdoutSocket = newSocket()
|
||||||
msgs.writelnHook = proc (line: string) =
|
msgs.writelnHook = proc (line: string) =
|
||||||
stdoutSocket.send(line & "\c\L")
|
stdoutSocket.send(line & "\c\L")
|
||||||
while true:
|
|
||||||
accept(server, stdoutSocket)
|
accept(server, stdoutSocket)
|
||||||
|
|
||||||
stdoutSocket.readLine(inp)
|
stdoutSocket.readLine(inp)
|
||||||
action inp.string
|
action inp.string
|
||||||
|
|
||||||
stdoutSocket.send("\c\L")
|
stdoutSocket.send("\c\L")
|
||||||
stdoutSocket.close()
|
stdoutSocket.close()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue