looking for Socket.select with maximum time or other solution

Nathan Reed nathaniel.reed at gmail.com
Sun Oct 7 15:30:15 PDT 2007


Charma wrote:
> Hello everyone!
> I am currently working on a server which many clients can connect to and 
> i am using socket.select with my socketset which all clients are in. 
> This far everything works very fine. But i would prefer my server-loop 
> to continue e.g. at least 10 times every second to work on other things 
> even when nothing is send from clients.

I'd use a separate thread for that.

> Also i would like to know: Is there any way i can cancel socket.select 
> while it is waiting? I mean, i would like to be able to quit my server 
> clean without needing to connect with a client again and so on...

How about, from another thread, killing the thread that is running 
select?  Yeah, a little bit clumsy, but at least you don't have to kill 
the process from the console.

Thanks,
Nathan Reed


More information about the Digitalmars-d-learn mailing list