I was wondering if I could write a C socket program to remotely check the number of TCP connections a web server can accept concurrently. A naive solution which I came up with is to keep calling connect()
to the server port in a loop till I get a -1
status return. I am somehow convinced that there is a better way to do it, just could not find it anywhere.
Asked
Active
Viewed 327 times
1

yobro97
- 1,125
- 8
- 23
-
Your naive solution may fail due to client-side restrictions, e.g. the range of ephemeral ports available:( – Martin James Apr 07 '19 at 10:57
-
@MartinJames how do you suggest me to proceed then? – yobro97 Apr 07 '19 at 14:36
-
Oh, I have no answer. How did you become 'somehow convinced' that this is reliably possible at all? – Martin James Apr 07 '19 at 17:42