Reputation: 1195
The System.Net.Sockets.Socket.Listen()
function requires a backlog
argument, which is the max number of connections that Listen()
can queue up.
To determine the maximum number of connections you can specify, retrieve the
MaxConnections
value.
MaxConnections: Not supported; will throw a SocketException if used.
So the documentation for this MaxConnections
enumeration says not to use it, but doesn't give an alternative. How do I determine the max connections, so that I have a value to pass into the Socket.Listen()
function?
Upvotes: 10
Views: 1343
Reputation: 4573
Exception will be thrown when you will try to set socket option and use MaxConnections
as an option name, e.g.
listenSocket.SetSocketOption(..., SocketOptionName.MaxConnections, ...);
In contrast, as a backlog
argument it is meant to be used.
Upvotes: 3