T
tracksun
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TForm1 = class(TForm)
IdTCPClient1: TIdTCPClient;
IdTCPServer1: TIdTCPServer;
Memo1: TMemo;
Button1: TButton;
procedure IdTCPServer1Execute(AThread: TIdPeerThread);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
Memo1.Lines.Add(AThread.Connection.Socket.Binding.PeerIP)
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdTcpClient1.Connect;
IdTcpClient1.WriteLn('Hello');
end;
问题:当按下Button1后,Memo1的内容会不断增加,请问为什么会不停地重复执行IdTcpServer1.OnExecute事件?
TForm1 = class(TForm)
IdTCPClient1: TIdTCPClient;
IdTCPServer1: TIdTCPServer;
Memo1: TMemo;
Button1: TButton;
procedure IdTCPServer1Execute(AThread: TIdPeerThread);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
Memo1.Lines.Add(AThread.Connection.Socket.Binding.PeerIP)
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdTcpClient1.Connect;
IdTcpClient1.WriteLn('Hello');
end;
问题:当按下Button1后,Memo1的内容会不断增加,请问为什么会不停地重复执行IdTcpServer1.OnExecute事件?