You could have a look at my attempt:
https://github.com/DannyArends/D-coding/tree/master/src/web
On 2012-03-05 09:38, Dmitry Olshansky wrote:
...
while(working){
if(select(set, null, null, 10) 0){ //10 usec wait on a socket, may do
plain 0
sock.accept(); // no blocking here
}
set.reset();
set.add(sock);
receiveTimeout(dur!us(1), (int code){ working = false; });
}
...
Thanks for the
On 05.03.2012 1:46, Vidar Wahlberg wrote:
Coming from a C++/Java world I find D's approach to concurrency slightly
difficult to grasp, perhaps someone could help me out a bit on this
problem:
I'd like to have a method that spawns a new thread which sets up a
socket and listens for
A more efficient approach is to use async socket routines and an event
object.
So, in main you create a shared event object, then start the listen thread.
In listen you call an async select or accept, and then wait on that /and/
the shared event object.
To stop listen you set the shared
On 05.03.2012 16:46, Regan Heath wrote:
A more efficient approach is to use async socket routines and an event
object.
So, in main you create a shared event object, then start the listen thread.
In listen you call an async select or accept, and then wait on that
/and/ the shared event object.
Coming from a C++/Java world I find D's approach to concurrency slightly
difficult to grasp, perhaps someone could help me out a bit on this problem:
I'd like to have a method that spawns a new thread which sets up a
socket and listens for connections (in a blocking fashion). This part is