Re[jcifs] connecting to Windows using JCIFS
Michael B Allen
miallen at ioplex.com
Fri Apr 25 14:46:47 GMT 2008
On Fri, 25 Apr 2008 00:25:02 -0700 (PDT)
marasim <marasim at gmail.com> wrote:
> Hi All:
> I am trying to connect to a Windows machine. If the Windows host goes down
> (shuts down, or network disconnects) and then comes back up after a while, I
> get this exception:
> jcifs.util.transport.TransportException: Transport1 timedout waiting for
> response to
If JCIFS tries to do IO with the server after it goes down you will get
However, JCIFS should recover. Can JCIFS perform RPCs with the target
server after it is back up?
> I have no idea why I get this, I know there is a timeout which I can
> increase, but even after increasing it to 10 minutes instead of the default
> 30 seconds, it doesn't try to reconnect.
> The strange thing is my code doesn't get the exception for me to catch, I am
> using DcerpcHandle and my guess is it calls the SmbTransport.send()
> somewhere which throws this exception.
That exception is coming from the transport thread so it will never be
thrown out to you. It is only logged.
However, the DcerpcHandle should throw it's own exception (timeout
or something like that). At that point the handle is probably invalid
(unlike transports, sessions and trees, internally JCIFS does not hang
onto DcerpcHandles - it only uses them for the operation being performed
and then they're closed).
Just as a matter of style, sleeping and then trying again in a loop
should be logic left to higher level code. For example, if you tried to
do an RPC with a machine that was off, JCIFS would throw that all the
way out to the user. Then they can decide if they want to do something
like sleep for a while and try again.
Michael B Allen
PHP Active Directory SPNEGO SSO
More information about the jcifs