🎉 Celebrating 25 Years of GameDev.net! 🎉

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!

speed of sockets

Started by
2 comments, last by djsteffey 23 years, 10 months ago
is there any speed difference in using sockets these two different ways ? 1) in a console application using non-blocking sockets every loop send out a packet and try to receive a packet, if no packet is there then it returns an error and I proceed in the program 2) ina win32 application where I just see if there is a received message or whatever the message is "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions
Advertisement
Single threaded apps are faster. Likes DOS is faster than windows. But today nobody cares about the overhead that windows and multiasking / - threading has, and you shouldn''t care, too.

Tim

--------------------------
www.gamedev.net/hosted/glvelocity
glvelocity.gamedev.net
www.glvelocity.com
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
i am just planning to use this on the server side which has no graphics, so I wasnt meaning the whole programming games for DOS versus Windows thing as the client is in windows with DirectX.
Just which would be better (faster) to use for the server side ? Dos or Windows ?


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

Single thread apps CAN be faster, however multi threading your server will provide you will many speed improvements.

1. Threads for waiting for player connections improve your main game loop as it can do other things while waiting for logins.

2. Threads to pool players (i.e. threads handling player connections) will improve performance.

Not mutlithreading your server is a mistake. You need the advanages that multiple threads give you.

The key is to balance the nubmer of threads/players connected and objects that these thread share.
Locking shared objects too much will downgrade your performace.

Look at sucessfull games like UO/EQ/AC all of which take advantage of threads.

This topic is closed to new replies.

Advertisement