[jcifs] jcif SmbCrawler

Richard Kogelnig Goblin at gmx.at
Tue Sep 30 01:14:34 EST 2003

i try to write a SmbCrawler with jcifs, but i face serious problems. Here is
my attempt:

import jcifs.smb.*;

public class SmbSafari {
  public static void main(String args[]){
	SmbFile f = null;
	String groups[];
	  f = new SmbFile("smb://");
	  groups = f.list();
	  System.out.println(groups.length+" workgroups found");
	  for(int i=0;i<groups.length;i++){
  	}catch(Exception e){

Sometimes it works well and i get a list of all workgroups, but most of the
time i get 

jcifs.smb.SmbException: Connection timed out: connect
	at jcifs.smb.SmbTransport.send(SmbTransport.java:626)
	at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:828)
	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:108)
	at jcifs.smb.SmbFile.connect(SmbFile.java:579)
	at jcifs.smb.SmbFile.connect0(SmbFile.java:549)
	at jcifs.smb.SmbFile.list(SmbFile.java:1147)
	at SmbSafari.main(SmbSafari.java:23)

And i just don't know why, i tried to change the timeouts too but it didn'´t
Strange is, that if i know a Workgroup, it's no problem to list the hosts in
it (e.g. smb://workgroup/) 
So i don't know why the connection at the broadcast times out

Thanks Richard.

NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

More information about the jcifs mailing list