A
Alex_Y
Unregistered / Unconfirmed
GUEST, unregistred user!
FastNet、Internet、IndyClicent、IndyServer下的UDP分别有什么区别和如何使用?最好有代码举例.尤其是Internet下的UDP控件我怎么也收不到自己发的程序奇怪啊,大家帮我看看:
procedure TForm1.Button1Click(Sender: TObject);
begin
UdpSocket1.RemoteHost := Edit1.Text;
UdpSocket1.Active := Active;
UdpSocket1.Sendln('udp protrol');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
UdpSocket1.Active := False;
UdpSocket1.DisConnect;
end;
procedure TForm1.UdpSocket1Receive(Sender: TObject; Buf: PChar;
var DataLen: Integer);
var
s: string;
begin
UdpSocket1.Receiveln(s);
if s <> '' then ShowMessage(s);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
UdpSocket1.RemoteHost := Edit1.Text;
UdpSocket1.Active := Active;
UdpSocket1.Sendln('udp protrol');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
UdpSocket1.Active := False;
UdpSocket1.DisConnect;
end;
procedure TForm1.UdpSocket1Receive(Sender: TObject; Buf: PChar;
var DataLen: Integer);
var
s: string;
begin
UdpSocket1.Receiveln(s);
if s <> '' then ShowMessage(s);
end;