Hello:
   I just started noticing this behaviour today, and
I seem to recall it working differently:  When
handling the OnClientDataAvailable event, if I
determine that the client needs to be disconnected, I
call (Sender As TMyClient).Shutdown(1).  The
connection is dropped fine, but the client object is
never freed until the server shuts down completely. 
Here's a sample of my code:

Procedure TMyServer.ClientDataAvailable(Sender:
TObject; Error: Word);
Begin
  With (Sender As TMyClient) Do Begin
    If (SomethingBadHappened) Then Begin
      SendLine('Error!');
      Shutdown(1);
    End;
  End;
End;

I call Shutdown(1) so that the connection is dropped
gracefully and the error response is received by the
client.  I don't recall changing this recently, so
I'm confused as to why it would have been destroying
the client before and not now (I may have changed
some of the default properties, though I don't recall
anything pertinent to this issue).  Perhaps there's
an even better way?

    Thanks for the help,
    -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