I programmed the above snippet to learn more about sockets and selectors in nim. In my example, server sleeps for 5 secs and then displays on the screen any message received. Client will send a message to the server via command arg (that is, i open a socket, send a message, and close it)
Now, if while the server is asleep i send 2 messages, next time the selector selects it will only display one, sleep for 5 secs, and display the other message.
I have tried to make the socket non-blocking and trying to read more than once using recvFrom, but it throws an expection. Give me a hand please.
@Quikli Perhaps it is time to get rid of that warning. This forum uses asyncdispatch and asyncnet extensively and it's working fine. There are still some issues to do with try statements in async procs though. In general though, it's pretty solid.