[jcifs] Re: Re: Disconnect from a share

Michael B Allen mba2000 at ioplex.com
Fri Oct 14 17:27:31 GMT 2005


On Fri, 14 Oct 2005 14:16:08 +0200
Alexander Saupp <asaupp at web.de> wrote:

> 	>passing an SmbComLogoffAndX is invalid. You got lucky because the
> 	>SmbComLogoffAndXResponse decodes no data. A more appropriate object
> 	>would be SmbComBlankResponse.
> 
> 	>But passing null to the transport indicates that it should not to wait
> 	>for the response. This is slightly faster since we can move on to other
> 	>things rather than sit there collecting a logging off response which
> 	>has no useful information in it.
> 
> 	>The problem is that first of "other things" is to close the socket but
> 	>apparently Samba hasn't written it's response yet so when it tries to
> 	>do so it get's an error (albeit a harmless one).
> 
> I would be very interessted to have the Patch Michael proposed inside - putting
> a 'new SmbComBlankResponse()' instead of null avoids that nasty errors Mathias mentioned.
> Any chance to get that fix into one of the next versions?

No, because specifying a response causes the transport layer to wait
for it.

> 	>> I'm still very interessted in a disconnect() method , because I use jcifs
> 	>> to monitor multiple samba servers (up to 100).
> 	>> And I must create a new connection each 10-15 seconds.A disconnect() method
> 	>> would help to save a lot of
> 	>> resources (# of threads) und would make life easier.
> 
> 	>Again, the proper solution here is to add refcounting to the
> 	>transport. That way you can leave soTimeout at 15 seconds (actually in
> 	>your case you would probably want to make it 5 seconds) but when a request
> 	>is outstanding on the transport it cannot be closed. That change is too
> 	>invasive for me to add to mainline while we're in a stable period so
> 	>you might elect to simply extend SmbFile to add your disconnect() method.
> 
> 	...
> 
> Is there a JCIFS roadmap showing in which version / around what time its planned to have the
> refcounting feature? Is that something you are working on allready? 

No, I'm not sure the refcounting is actually the best solution.

Tell me what your problem is rather than what you think your solution is.

Mike


More information about the jcifs mailing list