Java RMI - Client Timeout

前端 未结 4 1551
走了就别回头了
走了就别回头了 2020-11-30 05:53

I\'m building a Distributed System using Java RMI and it must support a server loss.

If my client is connected to a Server using RMI, if this server goes down (cable

4条回答
  •  無奈伤痛
    2020-11-30 06:41

    I recently encountered this problem as well and found that I needed to set the following Java property in order for an RMI call to timeout on the client side:

    sun.rmi.transport.tcp.responseTimeout
    

    Here is the full scoop on these params in newer versions of Java:

    • http://docs.oracle.com/javase/6/docs/technotes/guides/rmi/sunrmiproperties.html
    • http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/sunrmiproperties.html

提交回复
热议问题