commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1479116 - in /commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp: LateralTCPSender.java utils/
Date Sat, 04 May 2013 14:52:08 GMT
Author: tv
Date: Sat May  4 14:52:07 2013
New Revision: 1479116

URL: http://svn.apache.org/r1479116
Log:
Remove obsolete class and package

Removed:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/utils/
Modified:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java?rev=1479116&r1=1479115&r2=1479116&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
(original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
Sat May  4 14:52:07 2013
@@ -24,13 +24,13 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.Socket;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.lateral.LateralElementDescriptor;
 import org.apache.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
-import org.apache.jcs.auxiliary.lateral.socket.tcp.utils.SocketOpener;
 
 /**
  * This class is based on the log4j SocketAppender class. I'm using a different repair structure,
so
@@ -118,11 +118,19 @@ public class LateralTCPSender
             }
 
             // have time out socket open do this for us
-            socket = SocketOpener.openSocket( host, port, tcpLateralCacheAttributes.getOpenTimeOut()
);
-
-            if ( socket == null )
+            try
+            {
+                InetSocketAddress address = new InetSocketAddress( host, port );
+                socket = new Socket();
+                socket.connect( address, tcpLateralCacheAttributes.getOpenTimeOut() );
+            }
+            catch ( IOException ioe )
             {
-                throw new IOException( "Socket is null, cannot connect to " + host + ":"
+ port );
+                if (socket != null)
+                {
+                    socket.close();
+                }
+                throw new IOException( "Cannot connect to " + host + ":" + port, ioe );
             }
 
             socket.setSoTimeout( tcpLateralCacheAttributes.getSocketTimeOut() );



Mime
View raw message