adi-acm
asked on
How to retry on socket select?
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?
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?
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.