[jcifs] About disconnection.

tetsu.soh at nts.ricoh.co.jp tetsu.soh at nts.ricoh.co.jp
Wed Aug 30 01:18:46 GMT 2006



>
> On Tue, 29 Aug 2006 16:00:10 +0900
> tetsu.soh at nts.ricoh.co.jp wrote:
>
> > Hi everyone,
> >
> > I was reading JCIFS source code and found that we can't do disconnectio
> n
> > from outside of package.
> >
> > The disconnection() method in Transport class is only called when excep
> tion
> > is catched.
> >
> > Does it mean that If I create a Java App and connect to 10 different SM
> B
> > Server, the application will keep 10 socket connection alive?
> >
> > How can I close the connection without shutdown Java App?
>
> If there is no activity on the socket for jcifs.smb.client.soTimeout
> milliseconds, the socket read with throw a timeout exception and close
> the socket.
>
> Mike
>
> --
> Michael B Allen
> PHP Active Directory SSO
> http://www.ioplex.com/


 Thanks for your answer.

 I have noted what you said. But close action depends on timeing makes me
 feel unsafe and inconvenient.

 For example, (all action with SMB signing support) :

 First, I opened a connection using user AAA, do some stuff, and "logout".
 And then, I "login" as user BBB to do some thing. But this time, the SMB
 signing will failed.

 I think the reason is that although I did "logout" action, I cannot close
 connection to release all resources.
 So, when I did login again with different user, the jcifs re-used the
 connection and also the session key.

 So, to release all resources, the choice we have are 1) we shutdown
 application everytime we did "logout" 2) we wait for a while.
 Any advice about that?

 Thanks.




More information about the jcifs mailing list