![](smile.gif)
![](smile.gif)
![](wink.gif)
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
quote: Original post by phueppl1
Now, since I''m using UDP I''ll have to sort messages and kinda put them on a stack or something.
quote: Original post by phueppl1
They way I implemented it now, is that I got a thread the calls recvfrom(); all the time and sorts the received package onto the stack of the connection. Then the other thread just works of the messages from the stack. Now I wonder, would it be cleverer to put them together in one thread and make the socket non-blocking or is it ok to have 2 threads?
I see with no problem with 3 threads (main thread and 2 networking threads); Windows should only give each thred the processor power it needs…or at least it should if it doesn''t! I thought about doing this then got to thinking…hey I don''t have high bandwidth so the amount of data I''m sending over the net is minimal. I figured the game will be running at 30+ fps so the gap between frames updates to the server is not that bad. Since I don''t need to have *that* much info going out I deticated only a little part to my thread that sends stuff out (MAYBE 2 packets most likely 1 per every 3 frames); most of my data is comming in…no need to add in another thread, but yours might be different.
Hope this helps…if not sorry
Regards,
ecko_53
———————————————————–
"People who usualy use the word pedantic usualy are pedantic!"-me