Page 1 of 1

Memory questions...

Posted: Sun Aug 10, 2003 6:28 am
by Qwack
Hello guys,

I was reading through the Atomic Web Server source code, and I have a question.

Code: Select all

        Default
          RequestLength.l = ReceiveNetworkData(ClientID, *Buffer, 2000)
          Gosub ProcessRequest
How come Fred (the programmer) chose the data buffer length of 2000, and not smaller, or bigger? Why not 5000? Why not 1? What's the difference?

I hope someone can help clarify this.

Thank you very much in advance.

Posted: Sun Aug 10, 2003 10:51 am
by Num3
That has to do with the way the network protocol is configured...

Usually each tcp packet is 1500 bytes, so a 2000 bytes buffer is more than enough to ensure that even in extreme tweaked networks the each data packet is received!

Posted: Fri Aug 15, 2003 2:50 am
by Karbon
I'm still not sure if this is a decent example or not but if you're interested - I just re-did it..

I tried to explain everything, feel free to ask questions on the forum there or here..

http://www.purebasic.org/comments.php?id=P16_0_1_0