Home > Back-end >  Many packets of data set of DELPHI IDUDPSERVER receive package
Many packets of data set of DELPHI IDUDPSERVER receive package

Time:10-02

Procedure TForm1. IdUDPServer1UDPRead (AThread: TIdUDPListenerThread;
Const AData: TIdBytes; ABinding: TIdSocketHandle);
The begin
IF athread.Data=https://bbs.csdn.net/topics/NIL THEN
The BEGIN
MS:=MEMORYSTREAM. CREATE (NIL);
ATHERAD. DATA:=MS;
The END;
//the client send me a data in multiple packages, this event is a client sends a packet on the server within a single thread triggered, then how in this case, for the same client sends the package of a memory stream data on MS,
Now you can put the same client sends package ATHERAD. The corresponding memory DATA stream, the question is how
Sample to release the ATHERAD DATA, I think at the end of the thread automatically release do
end;

CodePudding user response:

Combination of UDP packets, the feeling is a complex project, I don't know the UDP packet loss, out-of-order yao, this question should be more important than how to release the memory stream.

CodePudding user response:

A receive a answer to solve the packet loss and out-of-order
  • Related