[jcifs] Continue

Michael B Allen ioplex at gmail.com
Wed Aug 15 11:44:23 MDT 2012


On Tue, Aug 7, 2012 at 3:55 AM, Jerwine Clark Badiang
<jbadiang at ntsp.nec.co.jp> wrote:
> Hi,
>
> Good day!
>
> I would like to confirm this behavior when copying files between computers
> using jcifs.
>
> 1. During the copying of files, the network connection was cut then restored
> after 1 minute. Will the copying of files continue using these properties:
> -Djcifs.smb.client.responseTimeout=1200000
>       -Djcifs.smb.client.soTimeout=1200000
>       -Djcifs.netbios.soTimeout=1200000
>
> 2. If the answer of #1 is No, what should be the needed property files to
> set.

Hi Jerwine,

That somewhat depends on whats really happening on the network when
the connection is "cut" and how you're copying files. There is no
retry logic in the copyTo routine. So if the underlying socket throws
an exception, at least one file will not be copied.

Note that there's a property that I don't think is documented which is:

  jcifs.smb.client.ignoreCopyToException = true

which if set to false will cause copyTo to throw an exception if it
fails to open, read, write etc. But the default is "true" which means
that an exception should not be thrown and it will just ignore the one
failed copy and log an error about it.

However, if the network just stalls for less than
jcifs.smb.client.responseTimeout (and jcifs.smb.client.soTimeout is
greater than or equal to that timeout so that the socket doesn't
close), then the copy should completely succeed.

If a machine is being rebooted, I'm not sure if communication will
just hang. As the machine is on it's way down and when it's on it's
way up, it is very possible that the server will return a "Connection
refused" or something similar. If the machine is actually off, then it
would hang.

If this is not the observed behavior, then please submit a detailed
description of what behavior you are seeing.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


More information about the jCIFS mailing list