Re: [twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-11 Thread Wilfried Mestdagh
Hello dz, You have to loop through the connected clients to send them a message. and send the shutdown. Take care that clients may be disconnected while in the loop, so something like this: for n := 0 to Srv.ClientCount - 1 do try Srv.Clients[n].SendStr('bye'#13#10);

Re: [twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-11 Thread DZ-Jay
Thanks, Wilfried. That's what I'm doing now. However, I'm doing it from the end of the Execute() method of the worker thread, right before destroying the server, like this: Procedure WorkerThread.Execute; Begin _InitializeSrv(); // create Try Srv.MessageLoop(); Finally Try