[jcifs] Re: Disconnect from a share
Michael B Allen
mba2000 at ioplex.com
Fri Aug 12 19:25:06 GMT 2005
On Fri, 12 Aug 2005 14:55:47 +0200
Ronny Schuetz <usenet-01 at groombridge34.de> wrote:
> Michael B Allen wrote:
> > That's what soTimeout does. When the transport is idle for longer than
> > jcifs.smb.client.soTimeout jCIFS will transmit the appropriate loggoff
> > and disconnect messages and then close the underlying socket. This should
> > not generate an error on the server or the client.
> >>@Michael: Would you kindly implement such a function , or do you accept a
> >>patch ?
> > If you can provide a compelling *reason* then yes. Otherwise, no.
> I'm planning to use jCIFS for a system that connects to several servers
> (>100) and transports files from one to another. Due to the global
> nature of the timeout settings, the timeout needs to be set to a high
> value, as the system is a) connecting servers distributed worldwide
> which are b) not responding as quickly as expected always. A prototype
> required timeout settings of 2min or more.
> So in such a scenario, it would be really nice, to be able to disconnect
> and close unnecessary connections immediately, instead of waiting until
> they time out wasting resources.
Adding a disconnect() method isn't the proper solution to this problem.
I think the refcounting technique I described eariler would be more
appropriate. For now you can easily extend SmbFile to modify the behavior
in a variety of ways.
More information about the jcifs