alper kamer
2008-06-22 11:55:33 UTC
I Use Delphi 5 and Indy 9.0.50
I tested this problem with very simple program on windows 2003 server.
I put TidTCPserver component on my form. And I set DefaultPort value to 6710. And I set Maxconnection value to 1
And my simple code is below:
procedure TForm1.FormCreate(Sender: TObject);
begin
TCPserver.Active := true;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
TCPserver.Active := false;
end;
procedure TForm1.TCPserverExecute(AThread: TIdPeerThread);
var bb: byte;
begin
Athread.Connection.ReadBuffer( bb, sizeof( bb ) );
end;
And I run this program. I connectted this program with telnet program like this
run-->cmd
telnet 127.0.0.1 6710 --> I saw 4 threads on task manager for project1.exe program.
it's first value was 3.
I opened second window for telnet: run-->cmd-->
telnet 127.0.0.1 6710 -->I saw 5 threads on task manager for project1.exe program.
This connection was refused by server program but new thread can not been terminated.
I closed this telnet window.
I opened third window for telnet: run-->cmd-->
telnet 127.0.0.1 6710 -->I saw 6 threads on task manager for project1.exe program.
This connection was refused by server program but new thread can not been terminated.
I closed this telnet window.
So I am sure there is one problem in Indy 9.0.50
How can I solve this problem?
I tested this problem with very simple program on windows 2003 server.
I put TidTCPserver component on my form. And I set DefaultPort value to 6710. And I set Maxconnection value to 1
And my simple code is below:
procedure TForm1.FormCreate(Sender: TObject);
begin
TCPserver.Active := true;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
TCPserver.Active := false;
end;
procedure TForm1.TCPserverExecute(AThread: TIdPeerThread);
var bb: byte;
begin
Athread.Connection.ReadBuffer( bb, sizeof( bb ) );
end;
And I run this program. I connectted this program with telnet program like this
run-->cmd
telnet 127.0.0.1 6710 --> I saw 4 threads on task manager for project1.exe program.
it's first value was 3.
I opened second window for telnet: run-->cmd-->
telnet 127.0.0.1 6710 -->I saw 5 threads on task manager for project1.exe program.
This connection was refused by server program but new thread can not been terminated.
I closed this telnet window.
I opened third window for telnet: run-->cmd-->
telnet 127.0.0.1 6710 -->I saw 6 threads on task manager for project1.exe program.
This connection was refused by server program but new thread can not been terminated.
I closed this telnet window.
So I am sure there is one problem in Indy 9.0.50
How can I solve this problem?