I believe you're right.

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [email protected]
Twitter: @oscerd2
Github: oscerd






On Tuesday, March 13, 2018, 8:33:51 PM GMT+1, Pascal Schumacher 
<[email protected]> wrote: 





Hello everybody,

took a look at the camel-smpp source code and noticed that is using 
javax.net.SocketFactory#createSocket(String host, int port) which 
"creates a socket and connects it to the specified port number at the 
specified address" according to the javadoc.

As Socket#setSoTimeout is called later on and 
Socket#connect(SocketAddress endpoint, int timeout) exists, I guess the 
initial connection is created without any timeout?

As blocking operations without timeouts should be avoided, should the 
code be changed to:

socket = socketFactory.createSocket();
socket.connect(new InetSocketAddress(host, port), timeout);

or am I missing something?

Thanks,

Pascal


Reply via email to