Z
zad
Unregistered / Unconfirmed
GUEST, unregistred user!
我用indy udp server 接收,为什么客户端 发两次才能收到 一次?而且,第一次、第三次、第五次。。。接受的数据丢掉了 ?
procedure Tmainform.UDPServerUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
DataStringStream: TStringStream;
s,substring,ip,view: String;
k,i,port,rlength:integer;
rrbuf,ssbuf:array[1..30] of byte;
begin
rlength:=adata.size;
udpserver.ReceiveBuffer(rrbuf,rlength,ip,port,-1);
edit1.Text:=abinding.PeerIP;
for i:=1 to rlength do
begin
view:=view+inttohex(rrbuf,1)+'_' ;
end;
udpmemo.lines.add(view);
view:='';
end;
请大家帮帮忙!我的分用光了.
procedure Tmainform.UDPServerUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
DataStringStream: TStringStream;
s,substring,ip,view: String;
k,i,port,rlength:integer;
rrbuf,ssbuf:array[1..30] of byte;
begin
rlength:=adata.size;
udpserver.ReceiveBuffer(rrbuf,rlength,ip,port,-1);
edit1.Text:=abinding.PeerIP;
for i:=1 to rlength do
begin
view:=view+inttohex(rrbuf,1)+'_' ;
end;
udpmemo.lines.add(view);
view:='';
end;
请大家帮帮忙!我的分用光了.