Results 1 to 9 of 9

Thread: How often to send packets?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    You should not send more than 3-4 packets per second and make sure to send self-sufficient information, so you can reconstruct the necessary part of the scene based on the information you have. If one packet gets lost, then you should be able to get latest information from the next packet. Plan your dead-reckoning accordingly to interpolate the frames between packet reception intervals (linear interpolation, cubic splines, etc.)

    I would recommend that both server and client keep sending packets. If no useful information is to be send, just send acknowledgement. This way, if client and/or server does not deceive anything within some time interval, it assumes that the remote party has been disconnected.

  2. #2
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Just out of curiosity, what library/interface are you using for your networking?
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  3. #3
    Since I do graphics in SDL, I went with SDL_net.

  4. #4
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Cool, whats the stability on sdl_net if you don't mind my asking? I tried the low level units supplied by the LCL but linux can be dodgy at times so I'm reviewing a better way of going abouts it without needing any dll/so files
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  5. #5
    So far I did not have any major problems. Reading from UDP packets via typecasts didn't really work, so I had to use a for, and I could not really find a way to determine TCP connection status (that is, detect disconnects) - but other than that, everything seems to work quite fine.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •