On Sunday, 20 April 2014 at 22:44:28 UTC, Bauss wrote:
I know the socket has the nonblocking settings, but how would I
actually go around using it in D? Is there a specific procedure
for it to work correctly etc.
I've taken a look at splat.d but it seems to be very outdated,
so that's why I went ahead and asked here as I'd probably have
to end up writing my own wrapper.
The "Socket" class has "blocking" property that is boolean.
Before starting to listening as a server socket, or connecting to
a server as client, if you set it to "false", then you can use
them (waiting for client with `accept` or receiving messages) as
asynchronous.
Already as you know, a client that is created from the `accept`
method of non-blocking server socket is non-blocking as well. So
you don't have to do anything about it.