[jcifs] After connecting to few hosts get Connection timed out: connect

Jacek Pasiek aksyl at wp.pl
Sun Jan 31 15:09:58 MST 2010


filesmb = new SmbFile("smb://"+Addr+"/");

Addr is an IP addresses

That's works in thread.

After every round Addr is increase.

After few, usually 10 rounds i've got an exception:

java.net.ConnectException: Connection timed out: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:525)
	at java.net.Socket.connect(Socket.java:475)
	at java.net.Socket.<init>(Socket.java:372)
	at java.net.Socket.<init>(Socket.java:186)
	at jcifs.smb.SmbTransport.ssn139(SmbTransport.java:185)
	at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:247)
	at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:312)
	at jcifs.util.transport.Transport.run(Transport.java:232)
	at java.lang.Thread.run(Thread.java:619)

Ofcourse if someone shares files it's working and puntting it into 
If an exception appear it starts getting more slowly and more slowly.
I don't want make many threads and split it for example: one thread : 
ten IPs to avoid problem.


More information about the jCIFS mailing list