Solved

How to retry on socket select?

Posted on 2006-12-01
3
270 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now