You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @hierynomus and @pepijnve,
I am getting connection time out error randomly when I tried to connect share folder from My Java program.
When debugging the code found out that while for mapping host name to IP InetAddress.getAllByName("hostname") is been used and it returns two IP address one of which is not getting connected and the other one works fine
is there any way to try to connect the working IP if the other one fails to connect?
java.net.SocketTimeoutException: Connect timed out
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
at java.base/java.net.Socket.connect(Socket.java:648)
at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:87)
at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:63)
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.connect(DirectTcpTransport.java:88)
at com.hierynomus.smbj.connection.Connection.connect(Connection.java:135)
at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:108)
at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:79)
The text was updated successfully, but these errors were encountered:
Hi @fazeem84
I believe your hostname has 2 ip addresses (May be a load balancer or IP address is getting changed often(i.e Elastic IP))
your issue is similar to #644
Resolution
Upgrade to SMBJ version 0.11.3
do a try catch and remove the server from the SMBClient serverlist.
Ex. smbclient.getServerList().unregister()
Hi @hierynomus and @pepijnve,
I am getting connection time out error randomly when I tried to connect share folder from My Java program.
When debugging the code found out that while for mapping host name to IP InetAddress.getAllByName("hostname") is been used and it returns two IP address one of which is not getting connected and the other one works fine
is there any way to try to connect the working IP if the other one fails to connect?
java.net.SocketTimeoutException: Connect timed out
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
at java.base/java.net.Socket.connect(Socket.java:648)
at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:87)
at com.hierynomus.protocol.commons.socket.ProxySocketFactory.createSocket(ProxySocketFactory.java:63)
at com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport.connect(DirectTcpTransport.java:88)
at com.hierynomus.smbj.connection.Connection.connect(Connection.java:135)
at com.hierynomus.smbj.SMBClient.getEstablishedOrConnect(SMBClient.java:108)
at com.hierynomus.smbj.SMBClient.connect(SMBClient.java:79)
The text was updated successfully, but these errors were encountered: