Memory questions...

Just starting out? Need help? Post your questions and find answers here.
Qwack
New User
New User
Posts: 6
Joined: Fri Jul 18, 2003 9:22 am

Memory questions...

Post 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.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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!
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply