hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r484775 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl: SocketHttpClientConnection.java SocketHttpServerConnection.java
Date Fri, 08 Dec 2006 20:57:37 GMT
Author: olegk
Date: Fri Dec  8 12:57:36 2006
New Revision: 484775

URL: http://svn.apache.org/viewvc?view=rev&rev=484775
Log:
Added #setSocketTimeout() method to SocketHttp*Connection classes

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java?view=diff&rev=484775&r1=484774&r2=484775
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
Fri Dec  8 12:57:36 2006
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
+import java.net.SocketException;
 
 import org.apache.http.HttpInetConnection;
 import org.apache.http.impl.io.SocketHttpDataReceiver;
@@ -125,6 +126,13 @@
         }
     }
 
+    public void setSocketTimeout(int timeout) throws SocketException {
+        assertOpen();
+        if (this.socket != null) {
+            this.socket.setSoTimeout(timeout);
+        }
+    }
+    
     public void shutdown() throws IOException {
         this.open = false;
         Socket tmpsocket = this.socket;

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java?view=diff&rev=484775&r1=484774&r2=484775
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
Fri Dec  8 12:57:36 2006
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
+import java.net.SocketException;
 
 import org.apache.http.HttpInetConnection;
 import org.apache.http.impl.io.SocketHttpDataReceiver;
@@ -123,6 +124,13 @@
         }
     }
 
+    public void setSocketTimeout(int timeout) throws SocketException {
+        assertOpen();
+        if (this.socket != null) {
+            this.socket.setSoTimeout(timeout);
+        }
+    }
+    
     public void shutdown() throws IOException {
         this.open = false;
         Socket tmpsocket = this.socket;



Mime
View raw message