Jump to content
  • Advertisement
Sign in to follow this  
Dzogchener

Concurrent Socket Connections and Design Implications (C#)

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

I came across the following document: http://msdn.microsoft.com/en-us/library/ms740550.aspx. At the end it says: "Large Number of Simultaneous Connections. Concurrent connections should not exceed two, except in special purpose applications. Exceeding two concurrent connections results in wasted resources. A good rule is to have up to four short lived connections, or two persistent connections per destination." I am currently designing a server that receives new connections on a single socket, but then, when it accepts a connection request results in a different socket object. There some aspects to how this works in .Net I am not yet solid with. But if I start with a socket and BeginAccept, then when I get a connection and call EndAccept(...) I get a new Socket I can use to communication wiht the client. Based on above, does this indicate a simultaneous connection? In the above statement it mentions destination - would it be correct to assume each client is a destination, and thus if I have 1000 clients, thats fine. If a client has 1000 connections, thats bad? Thanks, D

Share this post


Link to post
Share on other sites
Advertisement
If A wants to talk to B, why would there ever be more than one connection between them?

The rule sounds very familiar to HTTP recommendation, which makes me believe MS received a lot of hate mail from web admins who were getting hammered by web scrapers.

Or perhaps someone thought along the lines: Ok, 1 connection gets 100kb/s. So if I open 10, I'll get 1Mb/s. ANd if I open 10,000, I'll get gigabit connection. This is sadly the more probable reason...

Share this post


Link to post
Share on other sites
Hi Antheus,

I agree with you. I wasnt exactly sure from reading the MS post what a connection represented. But yes, one client only needs one connection to the server. Its the server side I was worried about. Now that I re-read the post its a bit clearer. Your last point I hadnt considered, and I can see that yes, opening multiple connections is not the right approach at best.

Thanks,

D.

Share this post


Link to post
Share on other sites
The nice thing with two TCP connections is that if one of them stalls out (say, for a dropped packet), the second may very well not, and keep going.

The theory of "download accelerators" is also that there's a pipe of limited size at the source of the file, and that pipe is shared equally between all connections. If there are N connections, you'll get 1/N of the bandwidth -- except, if you have 10 connections out of those N, you actually get 10/N of that bandwidth! (until such time as everybody uses download accelerators, of course)

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.

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!