Solved

How to retry on socket select?

Posted on 2006-12-01
3
275 Views
Last Modified: 2012-08-14
Hi,
In client side I am using async sockets to connect to the server. I have 300 clients connecting to the server. If 100 or more clients try to send a message at a time, many of the socket clients are timing out. I have client pseudo code some thing like this...

loop 3 times
     /////socket init

     connect....

     if connect returns WSAEWOULDBLOCK
           use socket select after random time between 1-2 sec.
      if success return

end loop

How do maximize the number of successful connects?
0
Comment
Question by:adi-acm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Akumas
ID: 18058631
probably reason is that windows socket cache size is limited, only 64K.
if you send too many udp packets at same time, packets will be ignored when cache if full.
for tcp stream, all data will wait until cache is available again.

unfortunately, windows socket cache seems can't be changed...
if you just want to test your server performance, try to put your clients to different PCs.
0
 

Author Comment

by:adi-acm
ID: 18064840
All the clients are different PCs. I run the test using a script. I am using TCP streams. Client tries for 15 seconds to get a connection after that retry logic stop trying for connection.
0
 
LVL 3

Accepted Solution

by:
Akumas earned 500 total points
ID: 18065358
how about your platform?
it says win xp sp2 limits 10 tcp connection per second by default.

see
http://www.mydigitallife.info/2005/11/15/windows-xp-sp2-tcp-connection-limit-event-id-4226/
or
http://archives.seul.org/or/talk/Mar-2005/msg00139.html
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question