Socket server + thread: cpu usage

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 1 06:24:48 PDT 2014


On Thursday, 1 May 2014 at 08:08:37 UTC, Tim wrote:
> ... the CPU usage goes up. I think that SocketShutdown.BOTH 
> causes Socket.select to fail which results in an endless loop. 
> Any suggestions how to handle that problem?

It shouldn't be here, disconnect would affect the new socket, and 
you're calling select on the accepting socket, which is still 
good to accept a new connection.

What's your code look like for handing a socket returned by 
accept?


More information about the Digitalmars-d-learn mailing list