You can use RecvPacket (it is high level and reads from the linebuffer). But I 
think what is meant here is that you can't expect RecvPacket to always get the 
entire package. The incoming data could be split up into several parts.

Each package is preceded by a length (in 3 bytes) and a package number. So when 
processing your incoming data you need to keep reading the buffer (keep doing 
buffer := buffer + recvpacket(2000) until you are sure you have the complete 
data package from the server before proceeding with processing that package. 
(You can peek or read in the buffer to see the header for checking the needed 
length of the buffer).

Because the packages for authentication are small, I don't think these would 
ever be fragmented. But going further with larger data packages you can't rely 
on that fact. Then you'll need to use a buffer mechanisme.

Maybe there is another way of looking at it. Other views and reading techniques 
are welcome 🤗

Grtz,
Rik


paste...@gmx.com schreef op 7 augustus 2023 02:20:54 CEST:
>
>Lukas would you mind expanding on what you said
>
>'It is stream based protocol, not packet based. So, usage of RecvPacket is a 
>big mistake here.'
>
>then it seems to be 'contradicted' by
>
>'on the reply packet structure. It using RecvPacket internally, and receive 
>multiple packets if it is needed.'
>


_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to