我需要一个简单的例子:
IdTCPClient ==> 传消息到==> IdTCPServer
IdTCPServer ==> 传消息到==> IdTCPClient
IdTCPClient ==> 传消息到==> IdTCPServer
IdTCPServer ==> 传消息到==> IdTCPClient
解决方案 »
- 如何判断是否assign了文件?
- win32编程,用7,8,9哪个版本的Delphi好一点。有企业版个人版一些版本,应该选择哪个版本??????
- HDC = type LongWord;是什么意思
- fastreport 为什么不能连续打印?谁能帮帮我?
- linzhengqun(风) 进来领分!!!!感谢(2)
- 用ADOStoredProc1怎么返回一个有多个查询结果的数据集
- 关于Delphi里随机函数的问题
- 请问大家那里有project2000下载的?
- TWebBrowser无法全部获取网页源码..
- 一个关于winexec的问题,怎么会这样?
- 高级DELPHI群,有李维,等高手在群内指导.
- 求Delphi下Gdi+ 开发所需要用到的GDIPAPI, GDIPOBJ, GDIPUTIL等pas文件, 急!!!
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
self.IdTCPServer1.DefaultPort:=88888;
self.IdTCPServer1.Active:=true;self.IdTCPClient1.Host:='127.0.0.1';
self.IdTCPClient1.Port:=88888;
try
self.IdTCPClient1.Connect( 5000 );
self.IdTCPClient1.Write( 'aaaaa' );
showmessage( self.IdTCPClient1.ReadLn() );
self.IdTCPClient1.Disconnect;
except
end;end;procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
with AThread.Connection do
begin
if ReadLn = 'aaaaa' then
begin
Write( 'hello world' );
end;
end;
end;
\Program Files\Borland\Delphi6\Demos\Internet\Chat\
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
self.IdTCPServer1.DefaultPort:=88888;
self.IdTCPServer1.Active:=true;self.IdTCPClient1.Host:='127.0.0.1';
self.IdTCPClient1.Port:=88888;
try
self.IdTCPClient1.Connect( 5000 );
self.IdTCPClient1.Write( 'aaaaa' );
showmessage( self.IdTCPClient1.ReadLn() );
self.IdTCPClient1.Disconnect;
except
end;end;procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
with AThread.Connection do
begin
if ReadLn = 'aaaaa' then
begin
Write( 'hello world' );
end;
end;
end;