TCP Packets and Size

Blitz3D Forums/Blitz3D Beginners Area/TCP Packets and Size

YellBellzDotCom(Posted 2007) [#1]
Howdy,

I am starting into the TCP end of my program. I got the chat up and running but there are a few things I was looking to understand a little bit better.

ClientMsg = ReadString(P\stream) will read an incomming stream from a client. Is this considered a packet?

How do you find out the size of the packet?

Therell probably be some more questions, but thanks for any help.


Gabriel(Posted 2007) [#2]
A packet is just a chunk of data. Packets are as big or as small as you make them. If I recall correctly, the only practical way to make packets composed of multiple pieces of data in B3D is with strings, in which case the packet size is not really a concern, because ReadString handles that for you. In that case, the packet size is the length of the string.


YellBellzDotCom(Posted 2007) [#3]
thats pretty much what I figured, thanks for the input there.

So if a packet contains the string "Welcome to my server." the lenght of the string would be 21, but how many bytes would this string contain?

Im looking to add bytes sent and recieved on my little network tester.

Thanks again.