Code is simillar to:
procedure TdmServer.tcpServerCommandHandlers0Command(ASender: TIdCommand);
begin
ASender.Thread.Connection.Disconnect;
end;
The server disconnects (and triggers the OnDisconnect event), but the client
doesn't seem to know.
Thanks
-- Jim
This is a know issue. The way around is, is to let the server issue a last
command, and then close the connection from it's side. When the client
receives the last command. It shut's down it's own connection from it's
side.
If you don't notify the client that it has to shut down, it won't know that
the connection is closed.
Another approach is doing it the other way around. Let the client issue a
disconnect command to the server, and disconnect immedeately (sp?) after
that. Server terminates as normal..
hth,
Marco..
Its actually by design - of not only Indy but TCP.
> command, and then close the connection from it's side. When the client
> receives the last command. It shut's down it's own connection from it's
> side.
Which is why nearly every protocol "agrees" to disconnect, then BOTH sides disconnect so that no
sockets are left in intermediate states.
--
Chad Z. Hower (Kudzu) - http://www.pbe.com/Kudzu/
Current Location: St. Petersburg, Russia
"Programming is an art form that fights back"