Re: Client locks up on RMI call to firewalled computer

Gregg Wonderly <[email protected]> Mon, 22 May 2006 09:05:30 -0700
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Joshua ChaitinPollak wrote:
> Hello,
>
> I know the 'RMI vs. Firewall' issue has been much discussed, but I
> think my problem is slightly different.
>
> When our application makes an RMI call to another application running
> on Windows XP with the built in firewall turned on, the calling
> application locks up indefinitely. When the firewall is turned off
> the RMI call works, and when the XP machine is shut down, we get an
> exception.
>
> What I'm looking for is a way to set RMI up so that the call to the
> firewalled machine fails in a reasonable amount of time, rather than
> just getting swallowed and freezing the program.
>
> Any thoughts?

If you are certain of the issues associated with allowing timeouts on the socket
I/O to occur, you can create a socket factory, and use setSOTimeout() on the
socket to set an upper bound on the time that any particular read will wait.

Do you know if the "freeze" is occuring on a "connect" or "read" or "write"
call?  Can you get a thread dump (with CTRL-BREAK or via JConsole in jdk1.5 and
later) that helps you see exactly where the problem is?

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html