camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] branch camel-2.21.x updated: CAMEL-12358: Camel-SMPP: Use timeout when creating socket connection
Date Sat, 17 Mar 2018 13:09:22 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
     new b6ebc62  CAMEL-12358: Camel-SMPP: Use timeout when creating socket connection
b6ebc62 is described below

commit b6ebc62544fcc2dbeaa942298ecd9743c48d77eb
Author: Pascal Schumacher <pascalschumacher@gmx.net>
AuthorDate: Fri Mar 16 19:24:32 2018 +0100

    CAMEL-12358: Camel-SMPP: Use timeout when creating socket connection
---
 .../org/apache/camel/component/smpp/SmppConnectionFactory.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConnectionFactory.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConnectionFactory.java
index cab3301..76e65fa 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConnectionFactory.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConnectionFactory.java
@@ -52,6 +52,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.net.InetSocketAddress;
 import java.net.Socket;
 
 import java.util.Map;
@@ -90,10 +91,14 @@ public final class SmppConnectionFactory implements ConnectionFactory
{
                 .getDefault() : SocketFactory.getDefault();
             if (config.getHttpProxyHost() != null) {
                 // setup the proxy tunnel
-                socket = socketFactory.createSocket(config.getHttpProxyHost(), config.getHttpProxyPort());
+                socket = socketFactory.createSocket();
+                // jsmpp uses enquire link timer as socket read timeout, so also use it to
establish the initial connection
+                socket.connect(new InetSocketAddress(config.getHttpProxyHost(), config.getHttpProxyPort()),
config.getEnquireLinkTimer());
                 connectProxy(host, port, socket);
             } else {
-                socket = socketFactory.createSocket(host, port);
+                socket = socketFactory.createSocket();
+                // jsmpp uses enquire link timer as socket read timeout, so also use it to
establish the initial connection
+                socket.connect(new InetSocketAddress(host, port), config.getEnquireLinkTimer());
             }
 
             if (config.getUsingSSL() && config.getHttpProxyHost() != null) {

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

Mime
View raw message