Solved

How to retry on socket select?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 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 member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

813 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

17 Experts available now in Live!

Get 1:1 Help Now