rocedure TUDPMainForm.UDPServerUDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);
var
abc:TestRecord;
begin
AData.ReadBuffer(abc,3);
end;
procedure TUDPMainForm.SendButtonClick(Sender: TObject);
var
abc: TestRecord;
begin
abc.a:='This is A zhi yu!';
abc.b:='BBBBBBBBB';
abc.c:=123;
ReceivedString:= inttostr(sizeof(abc)) ;
UDPClient.SendBuffer(abc,sizeof(abc));
end;
发送没问题,但一接收就出错,不知是何原因?