[jcifs] About the long crawling time again...

torjo845 at student.liu.se torjo845 at student.liu.se
Fri Aug 3 16:59:18 EST 2001


Ok, I'll soon stop bugging you about this... Promise...

I've written a short testprogram that just takes a pcname as argument, 
creates a smbfile and then tests it wih exists(). The source code is 
available below.


astmatix <20> nmblookup 750
Added interface ip=130.236.186.15 bcast=130.236.186.255 
nmask=255.255.255.0
Sending queries to 130.236.186.255
name_query failed to find name 750
astmatix <21> java -Djcifs.properties=LinGet.prp Test 750
750 exists.

As you can see above, when running a nmblookup on 750 it fails, but 
when I directly after run my test program on it, it says that the share 
exists.
Then I run
astmatix <10> java -Djcifs.properties=LinGet.prp ThreadedSmbCrawler 
smb://750 1 1

(LinGet.prp contains only the line: wins = 130.236.230.9)

And I still (after about 15 minutes) haven't even gotten an exception.
There's probably a perfectly good explanation of what's going wrong, 
and the most likely cause is - well, me...

Here's the code for my test proggie:
-----------------------------------------------------------
import java.io.*;
import jcifs.smb.SmbFile;
//import java.util.*;

public class Test
{
        public static void main(String[] arg) throws IOException
        {
                SmbFile sF = new SmbFile("smb://"+arg[0]);
                String[] lista;
                if (sF.exists())
                {
                       System.out.println(arg[0] + " exists.");
                }
                else
                        System.out.println(arg[0]+" doesn't exist.");



        }
}
-------------------------------------------------

----- Original Message -----
From: "Allen, Michael B (RSCH)" <Michael_B_Allen at ml.com>
Date: Thursday, August 2, 2001 10:46 pm
Subject: RE: [jcifs] About the long crawling time again...

> This depends on a lot of things Torgny. It's very hard for me to 
> tell whats going on
> without looking at your code. If you call exists() then, yes, 
> obviously it should
> return an accurate value for that particular moment in time. 
> However, if you make
> this test and then put the URL into a list that might not be 
> traversed again for some
> time then it might produce some funky results because the 
> Transport object will
> disconnect but still exist and I don't think it goes through all 
> the hula-hoops to
> reconnect. There are alot of other factors to consider too. For 
> example, are you
> using IP addresses as opposed to host names? Are you messing with 
> any properties
> like retryTimeouts, soTimeouts, retryCounts, etc? Are you still 
> using your WINS ip
> for baddr? Does the ThreadedSmbCrawler produce these exceptions?
> 
> Mike
> 
> > -----Original Message-----
> > From:	Torgny Johansson 
[SMTP:torgny.johansson at kommun.ljungby.se]
> > Sent:	Thursday, August 02, 2001 10:26 AM
> > To:	jcifs at samba.org
> > Subject:	[jcifs] About the long crawling time again...
> > 
> > Ok, let's say that it's taking so long to do the crawl because 
> some of the
> > pcs in the list are shut down when my crawler comes around to 
> them. I've put
> > a "if SmbFile.exists()" that should check whether or not the 
> specified share
> > exists or not right? If the pc isn't turned on, shouldn't this 
> say that the
> > pc isn't available, and my crawler should go on to the next one? 
> A pc that
> > seems to be turned off obviously get a true value from the 
> exist() method
> > otherwise the crawler would skip it.
> > 
> > 
> > 
> 
> 
> 





More information about the jcifs mailing list