Does anyone know how to close a Java RMI client connection between client and server such that the TCP connection is really closed and not just put in a wait state before it times out.
Right now when I send an RMI request, my app waits a few seconds and sends another RMI request. The Java RMI implementation will reuse the TCP connection, it will not open a new connection for each request. I would like to force it to open a new TCP connection for each request.
解决方案
AFAIK the API will not allow this as it is too high level. It has been optimised to assume that in most cases after making the connection it is better to keep it open as there will eb a subsequent call shortly afterwards.