W
wanglong3
Unregistered / Unconfirmed
GUEST, unregistred user!
服务器端:
procedure TForm1.Button1Click(Sender: TObject);
begin
WSocket1.Proto:= 'tcp';
WSocket1.Addr:= '0.0.0.0';
WSocket1.Port:= '10004';
WSocket1.Listen;
end;
procedure TForm1.WSocket1DataAvailable(Sender: TObject; Error: Word);
begin
showmessage('有消息了');
end;
客户端:
procedure TForm1.Button1Click(Sender: TObject);
begin
WSocket1.Proto := 'tcp';
WSocket1.Addr := '127.0.0.1';
WSocket1.Port := '10004';
WSocket1.Connect;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
WSocket1.SendStr('eeee');
end;
按理说,客户端发送'eeee'字符串后,服务器会弹出('有消息了');的字样啊,怎么不弹出啊?
procedure TForm1.Button1Click(Sender: TObject);
begin
WSocket1.Proto:= 'tcp';
WSocket1.Addr:= '0.0.0.0';
WSocket1.Port:= '10004';
WSocket1.Listen;
end;
procedure TForm1.WSocket1DataAvailable(Sender: TObject; Error: Word);
begin
showmessage('有消息了');
end;
客户端:
procedure TForm1.Button1Click(Sender: TObject);
begin
WSocket1.Proto := 'tcp';
WSocket1.Addr := '127.0.0.1';
WSocket1.Port := '10004';
WSocket1.Connect;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
WSocket1.SendStr('eeee');
end;
按理说,客户端发送'eeee'字符串后,服务器会弹出('有消息了');的字样啊,怎么不弹出啊?