Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : closing an application over the network

www.cryer.info
Managed Newsgroup Archive

closing an application over the network

Subject:closing an application over the network
Posted by:"soonic" (xxsoon..@op.pl)
Date:Wed, 19 Dec 2007 23:19:43

Hi

I have server and client application. They both communicate together.
I have trouble of making my application.terminate when the connection is
broken on server side.

When I use Button to close application it works (sender is nil)

procedure TMainForm.ButtonClick(Sender: TObject);
begin
  IdTCPClientDisconnected(nil);
end;

procedure TMainForm.IdTCPClientDisconnected(Sender: TObject);
begin
    Application.Terminate;
end;

...but when the IdTCPClientDisconnected procedure is called in run-time
because the connection broke but it self then it doesn't close my
application. The Sender is IdTCPClient.

How to make my application.terminate when the connection breaks?

2) As I'm writing one question on different topic. How to make the program
that when it's closed it deletes by it self? Is this possible?

s.

Replies:

www.cryer.info
Managed Newsgroup Archive