Gatway sockets may time out prematurely.
Consider an outbound gateway with a connection factory that creates sockets with a soTimeout of 10 seconds, and a gateway remoteTimeout of 10 seconds.
At T0, a client sends a message and immediately receives the response.
At T5, a client sends a message but the server takes 6 seconds to respond.
The SO_TIMEOUT will cause the socket to throw a SocketTimeoutException at T10, and the client will timeout at T15 - the reply at T11 will fail to be written.
When used for request/reply scenarios, the TcpConnection should wait 2 SO_TIMEOUT intervals if the last send on the socket occurred within the first interval.