hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1789820 - in /httpcomponents/httpcore/trunk: httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/ httpcore5/src/examples/org/apache/hc/core5/http/examples/
Date Sat, 01 Apr 2017 17:10:34 GMT
Author: olegk
Date: Sat Apr  1 17:10:34 2017
New Revision: 1789820

URL: http://svn.apache.org/viewvc?rev=1789820&view=rev
Log:
HTTPCORE-451: fixed examples

Modified:
    httpcomponents/httpcore/trunk/httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/Http2FileServerExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncPipelinedRequestExecutionExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncRequestExecutionExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicGetExecutionExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostExecutionExample.java
    httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostWithTrailersExecutionExample.java

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/Http2FileServerExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/Http2FileServerExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/Http2FileServerExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/examples/org/apache/hc/core5/http/examples/Http2FileServerExample.java
Sat Apr  1 17:10:34 2017
@@ -83,7 +83,7 @@ public class Http2FileServerExample {
         }
 
         IOReactorConfig config = IOReactorConfig.custom()
-                .setSoTimeout(15000)
+                .setSoTimeout(15, TimeUnit.SECONDS)
                 .setTcpNoDelay(true)
                 .build();
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncFileServerExample.java
Sat Apr  1 17:10:34 2017
@@ -79,7 +79,7 @@ public class AsyncFileServerExample {
         }
 
         IOReactorConfig config = IOReactorConfig.custom()
-                .setSoTimeout(15000)
+                .setSoTimeout(15, TimeUnit.SECONDS)
                 .setTcpNoDelay(true)
                 .build();
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncPipelinedRequestExecutionExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncPipelinedRequestExecutionExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncPipelinedRequestExecutionExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncPipelinedRequestExecutionExample.java
Sat Apr  1 17:10:34 2017
@@ -55,8 +55,8 @@ public class AsyncPipelinedRequestExecut
     public static void main(String[] args) throws Exception {
 
         IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
-                .setConnectTimeout(5000)
-                .setSoTimeout(5000)
+                .setConnectTimeout(5, TimeUnit.SECONDS)
+                .setSoTimeout(5, TimeUnit.SECONDS)
                 .build();
 
         // Create and start requester

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncRequestExecutionExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncRequestExecutionExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncRequestExecutionExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncRequestExecutionExample.java
Sat Apr  1 17:10:34 2017
@@ -55,8 +55,8 @@ public class AsyncRequestExecutionExampl
     public static void main(String[] args) throws Exception {
 
         IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
-                .setConnectTimeout(5000)
-                .setSoTimeout(5000)
+                .setConnectTimeout(5, TimeUnit.SECONDS)
+                .setSoTimeout(5, TimeUnit.SECONDS)
                 .build();
 
         // Create and start requester

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
Sat Apr  1 17:10:34 2017
@@ -99,8 +99,8 @@ public class AsyncReverseProxyExample {
         System.out.println("Reverse proxy to " + targetHost);
 
         IOReactorConfig config = IOReactorConfig.custom()
-            .setSoTimeout(3000)
-            .setConnectTimeout(3000)
+            .setSoTimeout(3, TimeUnit.SECONDS)
+            .setConnectTimeout(3, TimeUnit.SECONDS)
             .build();
 
         final HttpAsyncRequester requester = AsyncRequesterBootstrap.bootstrap()

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicFileServerExample.java
Sat Apr  1 17:10:34 2017
@@ -90,7 +90,7 @@ public class ClassicFileServerExample {
         }
 
         SocketConfig socketConfig = SocketConfig.custom()
-                .setSoTimeout(15000)
+                .setSoTimeout(15, TimeUnit.SECONDS)
                 .setTcpNoDelay(true)
                 .build();
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicGetExecutionExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicGetExecutionExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicGetExecutionExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicGetExecutionExample.java
Sat Apr  1 17:10:34 2017
@@ -27,6 +27,8 @@
 
 package org.apache.hc.core5.http.examples;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.HttpConnection;
@@ -80,8 +82,8 @@ public class ClassicGetExecutionExample
         String[] requestUris = new String[] {"/", "/ip", "/user-agent", "/headers"};
 
         SocketConfig socketConfig = SocketConfig.custom()
-                .setConnectTimeout(5000)
-                .setSoTimeout(5000)
+                .setConnectTimeout(5, TimeUnit.SECONDS)
+                .setSoTimeout(5, TimeUnit.SECONDS)
                 .build();
 
         for (int i = 0; i < requestUris.length; i++) {

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostExecutionExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostExecutionExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostExecutionExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostExecutionExample.java
Sat Apr  1 17:10:34 2017
@@ -29,6 +29,7 @@ package org.apache.hc.core5.http.example
 
 import java.io.ByteArrayInputStream;
 import java.nio.charset.StandardCharsets;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
@@ -100,8 +101,8 @@ public class ClassicPostExecutionExample
         };
 
         SocketConfig socketConfig = SocketConfig.custom()
-                .setConnectTimeout(5000)
-                .setSoTimeout(5000)
+                .setConnectTimeout(5, TimeUnit.SECONDS)
+                .setSoTimeout(5, TimeUnit.SECONDS)
                 .build();
 
         String requestUri = "/post";

Modified: httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostWithTrailersExecutionExample.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostWithTrailersExecutionExample.java?rev=1789820&r1=1789819&r2=1789820&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostWithTrailersExecutionExample.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/examples/org/apache/hc/core5/http/examples/ClassicPostWithTrailersExecutionExample.java
Sat Apr  1 17:10:34 2017
@@ -27,6 +27,8 @@
 
 package org.apache.hc.core5.http.examples;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.ContentType;
@@ -60,8 +62,8 @@ public class ClassicPostWithTrailersExec
         request.setEntity(requestBody);
 
         SocketConfig socketConfig = SocketConfig.custom()
-                .setConnectTimeout(5000)
-                .setSoTimeout(5000)
+                .setConnectTimeout(5, TimeUnit.SECONDS)
+                .setSoTimeout(5, TimeUnit.SECONDS)
                 .build();
 
         System.out.println(">> Request URI: " + request.getUri());



Mime
View raw message