Browse Source

Merge pull request #845 from stuartwdouglas/master

Update to latest version and increase backlog
mcocciaTE 11 years ago
parent
commit
3c37770f3b

+ 2 - 2
undertow-edge/pom.xml

@@ -18,7 +18,7 @@
         <dependency>
         <dependency>
             <groupId>io.undertow</groupId>
             <groupId>io.undertow</groupId>
             <artifactId>undertow-core</artifactId>
             <artifactId>undertow-core</artifactId>
-            <version>1.0.0.Beta31</version>
+            <version>1.0.13.Final</version>
             <exclusions>
             <exclusions>
                 <exclusion>
                 <exclusion>
                     <groupId>org.jboss.xnio</groupId>
                     <groupId>org.jboss.xnio</groupId>
@@ -29,7 +29,7 @@
         <dependency>
         <dependency>
             <groupId>org.jboss.xnio</groupId>
             <groupId>org.jboss.xnio</groupId>
             <artifactId>xnio-api</artifactId>
             <artifactId>xnio-api</artifactId>
-            <version>3.2.0.Beta4</version>
+            <version>3.2.1.Final</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.jboss.xnio</groupId>
             <groupId>org.jboss.xnio</groupId>

+ 4 - 2
undertow-edge/src/main/java/hello/HelloWebServer.java

@@ -13,6 +13,7 @@ import io.undertow.Handlers;
 import io.undertow.Undertow;
 import io.undertow.Undertow;
 import io.undertow.UndertowOptions;
 import io.undertow.UndertowOptions;
 import io.undertow.util.Headers;
 import io.undertow.util.Headers;
+import org.xnio.Options;
 
 
 import javax.sql.DataSource;
 import javax.sql.DataSource;
 import java.io.IOException;
 import java.io.IOException;
@@ -115,10 +116,11 @@ public final class HelloWebServer {
     }
     }
     Undertow.builder()
     Undertow.builder()
         .addListener(
         .addListener(
-            Integer.parseInt(properties.getProperty("web.port")),
-            properties.getProperty("web.host"))
+                Integer.parseInt(properties.getProperty("web.port")),
+                properties.getProperty("web.host"))
         .setBufferSize(1024 * 16)
         .setBufferSize(1024 * 16)
         .setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
         .setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
+        .setSocketOption(Options.BACKLOG, 10000)
         .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
         .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
         .setHandler(Handlers.date(Handlers.header(Handlers.path()
         .setHandler(Handlers.date(Handlers.header(Handlers.path()
             .addPrefixPath("/json",
             .addPrefixPath("/json",

+ 3 - 3
undertow/pom.xml

@@ -13,17 +13,17 @@
         <dependency>
         <dependency>
             <groupId>io.undertow</groupId>
             <groupId>io.undertow</groupId>
             <artifactId>undertow-core</artifactId>
             <artifactId>undertow-core</artifactId>
-            <version>1.0.0.Beta31</version>
+            <version>1.0.13.Final</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.jboss.xnio</groupId>
             <groupId>org.jboss.xnio</groupId>
             <artifactId>xnio-api</artifactId>
             <artifactId>xnio-api</artifactId>
-            <version>3.2.0.Beta4</version>
+            <version>3.2.1.Final</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.jboss.xnio</groupId>
             <groupId>org.jboss.xnio</groupId>
             <artifactId>xnio-nio</artifactId>
             <artifactId>xnio-nio</artifactId>
-            <version>3.2.0.Beta4</version>
+            <version>3.2.1.Final</version>
         </dependency>
         </dependency>
         <!-- Database drivers -->
         <!-- Database drivers -->
         <dependency>
         <dependency>

+ 2 - 0
undertow/src/main/java/hello/HelloWebServer.java

@@ -13,6 +13,7 @@ import io.undertow.Handlers;
 import io.undertow.Undertow;
 import io.undertow.Undertow;
 import io.undertow.UndertowOptions;
 import io.undertow.UndertowOptions;
 import io.undertow.util.Headers;
 import io.undertow.util.Headers;
+import org.xnio.Options;
 
 
 import javax.sql.DataSource;
 import javax.sql.DataSource;
 import java.io.IOException;
 import java.io.IOException;
@@ -119,6 +120,7 @@ public final class HelloWebServer {
             properties.getProperty("web.host"))
             properties.getProperty("web.host"))
         .setBufferSize(1024 * 16)
         .setBufferSize(1024 * 16)
         .setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
         .setIoThreads(Runtime.getRuntime().availableProcessors() * 2) //this seems slightly faster in some configurations
+        .setSocketOption(Options.BACKLOG, 10000)
         .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
         .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
         .setHandler(Handlers.date(Handlers.header(Handlers.path()
         .setHandler(Handlers.date(Handlers.header(Handlers.path()
             .addPrefixPath("/json",
             .addPrefixPath("/json",