?
Solved

How to retry on socket select?

Posted on 2006-12-01
3
Medium Priority
?
277 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 1500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

718 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