I
If a Modbus/TCP client cannot get an immediate connection to the server, should it be left waiting, or should it get an immediate notification from the server?
There seems to be some disagreement between Microsoft and (most of) the rest of the world as to what should happen when the server's listen() backlog is full. The Microsoft TCP/IP stack sends back a RST, which is the same response the client would get if there were no listening socket. Other TCP/IP stacks send back nothing (as if the request had gone into a black hole) and the client will then repeat its initial SYN a few times and finally time out if it continues to get no response. This usually takes several seconds.
In the former case the client knows immediately that it cannot be serviced, but may consider this to be a permanent error.
In the latter case the client may hang until either the connect attempt times out or another client disconnects and the server now has free resources to service the new client.
Added to this is the complication of the backlog itself. If a connection backlog is allowed (and this again is TCP/IP stack-dependent; some stacks don't let you set the backlog to 0) then the client may think it has negotiated a successful connection but when it sends its first Modbus message it will be ignored, causing another wait and possible timeout.
From the point of view of the client, would you rather get an error back immediately if you cannot be serviced immediately, or would you rather be ignored and left to try again?
There seems to be some disagreement between Microsoft and (most of) the rest of the world as to what should happen when the server's listen() backlog is full. The Microsoft TCP/IP stack sends back a RST, which is the same response the client would get if there were no listening socket. Other TCP/IP stacks send back nothing (as if the request had gone into a black hole) and the client will then repeat its initial SYN a few times and finally time out if it continues to get no response. This usually takes several seconds.
In the former case the client knows immediately that it cannot be serviced, but may consider this to be a permanent error.
In the latter case the client may hang until either the connect attempt times out or another client disconnects and the server now has free resources to service the new client.
Added to this is the complication of the backlog itself. If a connection backlog is allowed (and this again is TCP/IP stack-dependent; some stacks don't let you set the backlog to 0) then the client may think it has negotiated a successful connection but when it sends its first Modbus message it will be ignored, causing another wait and possible timeout.
From the point of view of the client, would you rather get an error back immediately if you cannot be serviced immediately, or would you rather be ignored and left to try again?
