Solved

How to retry on socket select?

Posted on 2006-12-01
3
269 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

772 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

12 Experts available now in Live!

Get 1:1 Help Now