Using a tcp-outbound-gateway with a shared socket (single-use="false") is not very practical when the service being invoked is long-running; this is because the socket is reserved for use by each client in turn. This is required because the packets might be fragmented as well as the fact there is no correlation data (known to the framework) in the packets.
This is discussed at length in the reference manual, where the use of non-shared sockets or collaborating channel adapters is recommended.
However, if someone does configure such a gateway and the soTimeout on the socket is greater than the gateway's remoteTimeout, there is a risk of a subsequent client receiving the previous client's response.
The gateway MUST close the socket if the client times out, because the socket is dirty and cannot be reused.
The work around is to ensure the soTimeout is less than or equal to the gateway remoteTimeout (although see