Hi I built an app based on RMI. Client (which is applet) connects to a server and sends it's own stub so the server could also invoke client methods.
Everything works fine as long as client machine has public IP. But when he has not:
java.rmi.ConnectException: Connection refused to host: <here is client IP>; nested exception is: java.net.ConnectException: Connection timed out at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94) ...
This exception occurs when server for the first time tries to invoke remote method of the client.
Is there any solution for this problem? Thanks in advance.