Hi Yeah that sounds reasonable, have you checked the javadoc of the jdk operations? But in all regards I do think your suggestion seems better. You are welcome to do a PR / commit / JIRA etc.
On Tue, Mar 13, 2018 at 8:33 PM, 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 > > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
