[jcifs] Re: JCifs Modification

Michael B Allen mba2000 at ioplex.com
Sat Nov 8 07:11:36 EST 2003


Please send all messages to the jCIFS mailing list.

> Hello,
>
> I'm working for IBM Germany and we use JCIFS in one of our Projects. Thank
> you , great work !!!
> We use JCIFS to monitor a samba share but we must add a new jcifs client
> property to ensure that the
> monitoring is working right. I've added only 7 lines of code in the
> SmbTransport.getSmbTransport(...) Method
> to prevent jcifs from reusing the old connection (see below).
> Would you be so kind as to integrate this change into the next official

I have been planning to make this exact change for some time. Search
gmane.org for discussion about the ssnLimit property. I am a little busy
with 0.8 at the moment but I will do this in the next round.

Mike

>
> Thanks in advance.
>
> Class jcifs.smb.SMBTransport
>
> static synchronized SmbTransport getSmbTransport( UniAddress address, int
> port,
>  InetAddress localAddr, int localPort ) {
>         SmbTransport conn;
>
>         //Set reuseTransport to false , if you want to force a new
> connection for each request.
>         //Its necessary if you want to monitor the availability of a samba
> share.
>         boolean reuseTransport = Config.getBoolean(
> "jcifs.smb.client.reuseTransport", true );
>         if(reuseTransport){
>                 for( Enumeration e = connections.elements();
> e.hasMoreElements(); ) {
>                         conn = (SmbTransport)e.nextElement();
>                         if( conn.matches( address, port, localAddr,
> localPort )) {
>                                 return conn;
>                         }
>                 }
>                 conn = new SmbTransport( address, port, localAddr,
> localPort );
>                 connections.addElement( conn );
>         }else{
>                 conn = new SmbTransport( address, port, localAddr,
> localPort );
>         }
>
>         return conn;
> }
>
> mit freundlichen Grüßen / best regards

-- 
A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.



More information about the jcifs mailing list