Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 614
  • Last Modified:

Error working with delphi 7 and indy. I'm using TCPServer and TCPClient and I get the error when I try to change TCPServer ACTIVE property to false in order to close the form next.

When I change ACTIVE property from TCPServer in indy I get the next error: Terminate Thread Timeout.
When I close the form it also appears the same error.
The error doesn't appear if no clients have connected during the time server has been connected. Then server closes well.
I have tried to connect only one client and close the thread manually. I have done this:

1. when client connects

procedure TfServ.TCPServidorConnect(AThread: TIdPeerThread);
var ID: Integer;
begin
ID:= plFils.Add(AThread);
end;

Now I have a pointer of the TIdPeerThread in a pointer list. It's the first client it has connected so the index is 0. Then i try to terminate the thread:

procedure TfServ.bDesconnectarClick(Sender: TObject);
var Client: TIdPeerThread;
begin
Client:= plFils[0];
Client.Terminate;

end;

This is simple and has worked but when i change ACTIVE property to false or I close the form i have the same error, Terminate Thread Timeout, again. Do these things have any relation?

Does anybody know which is the problem? Why am I not able to close the program?

Thanks.
0
elhbow86
Asked:
elhbow86
1 Solution

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now