Posted by Phil Frisbie, Jr. on February 06, 2006 at 13:39:00:
In Reply to: Re: Network Memory Free ? posted by Selles on February 02, 2006 at 22:41:45:
: : : Hi Again, I'm getting to create my game network system.. but, what could I make case the net memory it ended? is there a function that return the free memory in bytes?
: :
: : What free memory?
: :
: : : My server send packets UDP to the client but don't know when must stop.. even so the server will send the package and it won't be received in the client because the net memory is full.. I remember that Phil Frisbie said that it should be made a system that controls loss of packages, but I don't have idea of how to begin that..
: :
: : Basically, in a game you should make it so that lost UDP packets are OK, and your game will recover. But there may be some packets that MUST get through, so you need to add an acknowledgment message (ack) to your game protocol for these 'reliable' packets, and resend the packet if you do not get the ack. Of course, you also need to handle duplicated packets since you might resend before you get the ack.
:
: Sorry my ignorance, the memory which I refer is the network buffer or that memory where is the line of the packages that they were not still read by the function nlRead(), I don't know I am if right but if there was a form of knowing as it remains of space it or or how many packages there are would avoid another problem that is the delay among the package in process and the last received, this means that as larger the delay will also be larger the time of answer of the remote player's commands in my terminal.
There is no way to get that information from the TCP/IP stack. UDP is not reliable, so you must just read them as fast as you can and process them.
: In my tests with two terminais in LAN that delay it was very big because the amount of packages received still not processed in the buffer is huge,
: if there was as knowing how many packages they are in the buffer waiting for they be read, this would facilitate, otherwise, the only solution that I see it is through calculations with the time of the command ping, i'm right?
I am not sure what you are asking here.
Phil