By the way.
I have already tried the timeout property when creating the Client instance, but this don't solve this problem :(
thanx in advance.
I just did an experiment in which I set the client's timeout to 1 second and pulled the ethernet plug out of the server machine. I'm using the socket transport, by the way. It took 30 seconds to get a timeout exception. What's happening is that the socket client invoker tries multiple times (30 by default) to get a connection, and each connection timed out after 1 second. The number of attempts can be configured by setting the numberOfRetries parameter.
Similarly, (also in the socket transport) if a connection has been established and then fails during the invocation, the invocation will be retried (3 times by default). The number of retries can be configured by setting the numberOfCallRetries parameter.
You might be experiencing something like this. See what happens if you run the client with the log level for org.jboss.remoting loggers set to DEBUG.
By the way, my client was on a Windows machine and my server was on a linux machine. Java sockets depend on the underlying operating system, and it's just a fact that different environments handle this problem differently. If you have the misfortune to be working in an environment that doesn't give you the support you need, you may have to handle the "unplugged cable" problem at the application level. Just to see that you're not alone, take a look at
A couple of strategies come to mind. The forum suggests pinging on the connection to see if it's alive, and Remoting can help you with that. Read about leasing and connection validation in Chapter 8 of the Remoting documentation:
Another possibility would be to put the invocation in a separate thread t, and then, in your main thread, call t.join(timeout).