Advertisement

Equal Connecting (Winsock)

Started by October 09, 2002 04:02 PM
4 comments, last by BioSquirrel 22 years, 3 months ago
I am making a game where every frame, both players send their coordinates and then they receive the other player''s coordinates. The server program receives, sends, receives, sends, etc. over and over. The problem is that the person who connects first hogs the connections with the server almost every time and the second player''s packets are lost way too many times. I made it so that player one only sends and receives every 5 frames so player two could fit in between it, but player two still receives very few times and it goes slow. Any ideas on how to get both players to send and receive from the server equal amounts?
uhh... what?
Advertisement
Basically, player one sends and receives from the server way more than player two and player two has to fit in packets and doesn''t connect very often.
Is it possible player 2 is just on a crap connection and the packets are getting lost before they ever get to the server?
Well that may be a possibility because I am mostly testing both players on one computer.
The threading is basically hogging all the cpu time for one task and the other task isn''t getting much CPU time. Try putting in a forced Sleep(15) and see if you get different results...
Martin Piper

This topic is closed to new replies.

Advertisement