Re: Async socket to server connection error handling

2019-08-02 Thread adokitkat
Thanks for replies! How about timeout for async connect? What's the correct way to do it?

Re: Async socket to server connection error handling

2019-08-02 Thread treeform
You need to use waitFor instead of await if you want to run {.async.} proc in non {.async.} context. when isMainModule : waitFor mastercon() Run

Re: Async socket to server connection error handling

2019-08-02 Thread qqtop
But await works only inside an async proc were as asyncCheck can be used like this: when isMainModule : asyncCheck mastercon() runForever() Run How can we do: when isMainModule : await mastercon() runForever()

Re: Async socket to server connection error handling

2019-08-02 Thread dom96
Yes, `connect` raises when it cannot connect. I'm guessing you've been using `asyncCheck` and trying to catch the exception by wrapping `try` around that... you need to use `await`.

Async socket to server connection error handling

2019-08-01 Thread adokitkat
Hello guys. Is there any way to find out if async socket _proc connect()_ has established a connection or not - it just returns Future[void] either way - or a proper way to handle refused connections? My program crashes when I call await socket.recvLine() Run for a so