Home > Back-end >  How can receive the packet length using IdTCPServer
How can receive the packet length using IdTCPServer

Time:10-14

I use IdTCPSrever control in c + + Builder 2010 receive packets sent, in the event IdTCPServer1Execute (TIdContext * AContext) used in AContext - & gt; Connection - & gt; IOHandler - & gt; ReadBytes (SendBuffer1, 3, false); Method receives the packet was sent, because the length of the packet is not fixed, therefore in the length of the parameter (in this case, 3) what's the length of the received data packets cannot be obtained, I find for a long time, don't know which property can get packet length, which master can know, in this thank you first!

CodePudding user response:


AContext - & gt; Connection - & gt; IOHandler - & gt; The InputBuffer - & gt; Size

CodePudding user response:

When the client contract, first send me the length of the packet, and then specify the size of the server to read data,
  • Related