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

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); Srv.Clients[n].Shu

[twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-10 Thread [EMAIL PROTECTED]
Hello: I've noticed that when I use Shutdown(SD_BOTH), DisconnectAll(), or Free, all clients are disconnected gracefully. However, I was wondering if there is a way to intercept that the server is shutting down, so that I can send a "Server is shutting down. Connection closed." message before c