[jcifs] Thread leak problem on connect timeout
Data Shock
datashock at hotmail.com
Wed Jul 1 15:32:29 GMT 2009
Has anyone had a chance to look into this yet? It's very easy to reproduce.
I
modified my local copy of the source code to use the Socket.connect
method and no longer have the leak. (Note, I only changed SMB related
code so other code paths may still leak threads)
Here are the modifications I made to the 1.3.10 code:
1) In jcifs.smb.SmbTransport at line 181 in the ssn139 method, I changed the socket creation code to:
socket = new Socket();
if (localAddr != null) {
socket.bind(new InetSocketAddress(localAddr, localPort));
}
socket.connect(new InetSocketAddress(address.getHostAddress(), 139), RESPONSE_TIMEOUT);
2) In jcifs.smb.SmbTransport at line 248 in the negotiate method, I changed the socket creation code to:
socket = new Socket();
if (localAddr != null) {
socket.bind(new InetSocketAddress(localAddr, localPort));
}
socket.connect(new InetSocketAddress(address.getHostAddress(), port), RESPONSE_TIMEOUT);
3) In jcifs.util.transport.Transport at line 172 I removed the timeout argument from the wait command:
thread.wait(); /* wait for doConnect */
Is there any reason why this approach would not be valid for the JCIFS library?
Thanks,
DS
_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
More information about the jcifs
mailing list