Re: Continue
Michael B Allen <[email protected]> Wed, 15 Aug 2012 13:44:23 -0400
| Newsgroups | gmane.network.samba.java |
|---|---|
| Message-ID | <CAGMFw4iT9uAvvbVofSjhkbjJOVo=yK7d+h7z=mbQvdMiGt-oOQ@mail.gmail.com> |
On Tue, Aug 7, 2012 at 3:55 AM, Jerwine Clark Badiang <[email protected]> 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/