[grizzly~git:e33152a9] [master] + fix javadoc

  • From: oleksiys@...
  • To: commits@...
  • Subject: [grizzly~git:e33152a9] [master] + fix javadoc
  • Date: Wed, 5 Mar 2014 23:46:26 +0000

Project:    grizzly
Repository: git
Revision:   e33152a9105698d2959b93f86002984d134639a2
Author:     oleksiys
Date:       2014-03-05 23:19:14 UTC
Link:       

Log Message:
------------
[master] + fix javadoc
+ use forgotten clientSocketSoTimeout option (thanks to Matt)



Revisions:
----------
e33152a9105698d2959b93f86002984d134639a2


Modified Paths:
---------------
modules/grizzly/src/main/java/org/glassfish/grizzly/Buffer.java
modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOTransport.java
modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOTransport.java
modules/portunif/src/main/java/org/glassfish/grizzly/portunif/finders/HttpProtocolFinder.java


Diffs:
------
--- a/modules/grizzly/src/main/java/org/glassfish/grizzly/Buffer.java
+++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/Buffer.java
@@ -839,12 +839,12 @@ public interface Buffer extends Comparable<Buffer>, 
WritableMessage {
      * given {@link String} into this buffer.
      *
      * <p> In other words, an invocation of this method of the form
-     * <tt>dst.put(src)</tt> has exactly the same effect as
+     * <tt>dst.put8BitString(src)</tt> has exactly the same effect as
      * the loop
      *
      * <pre>
-     *     for (int i = 0; i < s.length(); i++)
-     *         dst.put((byte) s.charAt(i)); </pre>
+     *     for (int i = 0; i < src.length(); i++)
+     *         dst.put((byte) src.charAt(i)); </pre>
      *
      * except that it first checks that there is sufficient space in this
      * buffer and it is potentially much more efficient. </p>--- 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOTransport.java
+++ 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/NIOTransport.java
@@ -92,7 +92,7 @@ public abstract class NIOTransport extends AbstractTransport
     public static final int DEFAULT_SERVER_SOCKET_SO_TIMEOUT = 0;
 
     public static final boolean DEFAULT_REUSE_ADDRESS = true;
-    public static final int DEFAULT_CLIENT_SOCKET_SO_TIMEOUT = -1;
+    public static final int DEFAULT_CLIENT_SOCKET_SO_TIMEOUT = 0;
     public static final int DEFAULT_CONNECTION_TIMEOUT =
             SocketConnectorHandler.DEFAULT_CONNECTION_TIMEOUT;
     public static final int DEFAULT_SELECTOR_RUNNER_COUNT = -1;
@@ -347,6 +347,10 @@ public abstract class NIOTransport extends 
AbstractTransport
 
     @SuppressWarnings({"UnusedDeclaration"})
     public void setClientSocketSoTimeout(final int socketTimeout) {
+        if (socketTimeout < 0) {
+            throw new IllegalArgumentException("socketTimeout can't be 
negative value");
+        }
+        
         this.clientSocketSoTimeout = socketTimeout;
         notifyProbesConfigChanged(this);
     }
@@ -367,6 +371,10 @@ public abstract class NIOTransport extends 
AbstractTransport
 
     @SuppressWarnings({"UnusedDeclaration"})
     public void setServerSocketSoTimeout(final int serverSocketSoTimeout) {
+        if (serverSocketSoTimeout < 0) {
+            throw new IllegalArgumentException("socketTimeout can't be 
negative value");
+        }
+        
         this.serverSocketSoTimeout = serverSocketSoTimeout;
         notifyProbesConfigChanged(this);
     }--- 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOTransport.java
+++ 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOTransport.java
@@ -590,7 +590,7 @@ public class TCPNIOTransport extends NIOTransport {
             LOGGER.log(Level.WARNING,
                     
LogMessages.WARNING_GRIZZLY_SOCKET_TCPNODELAY_EXCEPTION(tcpNoDelay), e);
         }
-
+        
         final boolean reuseAddress = isReuseAddress();
         try {
             socket.setReuseAddress(reuseAddress);
@@ -598,6 +598,13 @@ public class TCPNIOTransport extends NIOTransport {
             LOGGER.log(Level.WARNING,
                     
LogMessages.WARNING_GRIZZLY_SOCKET_REUSEADDRESS_EXCEPTION(reuseAddress), e);
         }
+
+        final int clientSocketSoTimeout = getClientSocketSoTimeout();
+        try {
+            socket.setSoTimeout(clientSocketSoTimeout);
+        } catch (IOException e) {
+            LOGGER.log(Level.WARNING, 
LogMessages.WARNING_GRIZZLY_SOCKET_TIMEOUT_EXCEPTION(getClientSocketSoTimeout()),
 e);
+        }    
     }
 
     public int getLinger() {--- 
a/modules/portunif/src/main/java/org/glassfish/grizzly/portunif/finders/HttpProtocolFinder.java
+++ 
b/modules/portunif/src/main/java/org/glassfish/grizzly/portunif/finders/HttpProtocolFinder.java
@@ -42,7 +42,6 @@ package org.glassfish.grizzly.portunif.finders;
 
 import org.glassfish.grizzly.Buffer;
 import org.glassfish.grizzly.Connection;
-import org.glassfish.grizzly.Grizzly;
 import org.glassfish.grizzly.attributes.Attribute;
 import org.glassfish.grizzly.filterchain.FilterChainContext;
 import org.glassfish.grizzly.portunif.PUContext;
@@ -65,8 +64,7 @@ import org.glassfish.grizzly.portunif.ProtocolFinder;
 public class HttpProtocolFinder implements ProtocolFinder {
     private static final char[] METHOD_FIRST_LETTERS = new char[] {'G', 'P', 
'O', 'H', 'D', 'T', 'C'};
     private final Attribute<ParsingState> parsingStateAttribute =
-            Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute(
-                    HttpProtocolFinder.class + "-" + hashCode()
+            Attribute.create(HttpProtocolFinder.class + "-" + hashCode()
                             + ".parsingStateAttribute");
 
     private final int maxRequestLineSize;





[grizzly~git:e33152a9] [master] + fix javadoc

oleksiys 03/05/2014
Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20150626.29986a4)
 
 
Close
loading
Please Confirm
Close