Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Shadowed

My server model

This topic is 5222 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

Hello guys This the approximate model of my server. It uses reliable UDP and the game style is click-based [e.g. clicked-here-done-this, clicked-there-went-there]. I would like to know if the overall design is bad and how many online users approximately can I have on a HT P4 server.
main()
{
Server.Init()
Network.Init()

CreateIncomingThread()
CreateOutgoingThread()

while(true)
{
ProcessQueue()
PushResultIntoOutgoingQueue()
}

}



IncomingThread()
{
if (PollForPackets())
{
SendBackACKPacket();
PushRequestIntoProcessingQueue()
}
}

OutgoingThread()
{
SendOutgoingQueue()
}

Many people told me that polling is always BAD. What''s the better alternative for this model? Thanks very much.

Share this post


Link to post
Share on other sites
Advertisement
Polling the udp interface for packets is bad, consider using blocking sockets etc.

Polling your message handler is alright though, hell most of the people who handle their windows messages in a winapp just poll it in a loop.
I see nothing wrong with that, the overhead for a poll once per frame is going to be negliable.
(I''m sure that this post is going to argued )

Share this post


Link to post
Share on other sites
quote:
Original post by SoulSpectre
Polling the udp interface for packets is bad, consider using blocking sockets etc.

Polling your message handler is alright though, hell most of the people who handle their windows messages in a winapp just poll it in a loop.
I see nothing wrong with that, the overhead for a poll once per frame is going to be negliable.
(I''m sure that this post is going to argued )


Aren''t my sockets blocking already? I didn''t set them asynchronous or non-blocking anyhow..
or maybe I got you wrong

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!