[jcifs] Multiple host SMB Crawler

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Thu Apr 17 09:10:25 EST 2003


Please send all message to the jCIFS mailing list.

> -----Original Message-----
> From:	Dan Dumont [SMTP:Dan at canofsleep.com]
	<snip>
> However, what I found was that if I modified the maxMpxCount to 100 in your
> code.  The indexing program will run at full speed (note I tried setting
> this in the options and it didn't work...  at all.  Perhaps I am doing
> something wrong)
> 
	No, that is not read as property in the MpxControl constructor where your
	changing it.

> However, after about 100 ip address have been...  indexed, or discarded or
> whatever, all the threads lock up in
> synchronized int aquireMid() throws InterruptedException {
>             while( mpxCount >= maxMpxCount ) {
>                 wait();
>             }
> 
> ^^^  there.
> 
	That's right; mpxCount will be 100 so it waits for someone to make progress.

> Is the timeout like... really high or something, so high that if I let my
> computer work at this until after next Christmas it will finally give up and
> let me through?  
> 
	The "timeout" should be ~1min 15 seconds but this is not something jCIFS
	has any control over. If you try to connect to any randon IP (that is not listening)
	there will be no response to the initial SYN packet and that thread will hang for
	1min 15seconds. There is nothing you can do about it.

> Or is this a problem with my little code edit.
> 
	Not really.

> Or is this simply another unintended side effect?
> 
	You're running 100 threads that try to contact hosts that do not exist so the
	threads are hanging. They will not hang "until after next Christmas" but jCIFS
	is not ideal for port scanning of random IPs (or Java in general for that matter).

	Mike







More information about the jcifs mailing list