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].ShutDown(1);
  except
  end;

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Wednesday, October 10, 2007, 21:59, [EMAIL PROTECTED] wrote:

> 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
> closing.  I guess I could loop through the collection
> of connected clients and send them a message, but I
> was wondering if there was a better way.

>    -dZ.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to