Jump to content
  • Advertisement
Sign in to follow this  
Gogeta70

The best method?

This topic is 2584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone. I'm programming an anti-cheat client & server that features a ventrillo-like voice chat system. The client is made on windows, and the server is made on linux. I'm having a problem with the client maintaining a connection to the server, so i'm thinking that maybe my method for handling connections is wrong. My question to you is this:

What is the best method for handling a high volume of connections on a server? I've heard that select() is pretty slow. Right now i have the sockets set to non-blocking and i'm checking each socket with recv() in a loop, and creating a new thread to handle incoming data.

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It depends on your definition of "high volume". You seem to be talking about number of users, but with voice in the mix bandwidth could become a limiter too.

Have you read Q11 of the Forum FAQ?

A "thread per client" is usually an expensive way of handling connections. Although it sounds like you're receiving in a non-blocking fashion, then handing off just that data to a new thread? That sounds very expensive to me. A blocking select should consume less processor time, and you probably would be better off avoiding creating new threads often.

Where did you hear that select() is slow? It is typically the simplest and performs adequately for a wide variety of uses.

Have you considered offloading/delegating the voice chat, rather than trying to manage it all on one server? For example, you might be able to use the anti-cheat server as a introducer, and allow the clients to send the voice chat directly between one another.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!