[grizzly~git:58df60be] [master] Port fix for http://java.net/jira/browse/GRIZZLY-1420 (Need a wa

  • From: rlubke@...
  • To: commits@...
  • Subject: [grizzly~git:58df60be] [master] Port fix for http://java.net/jira/browse/GRIZZLY-1420 (Need a wa
  • Date: Fri, 1 Feb 2013 21:30:04 +0000

Project:    grizzly
Repository: git
Revision:   58df60be0b978d84b755b720605a144b260c2a50
Author:     rlubke
Date:       2013-02-01 21:29:50 UTC
Link:       

Log Message:
------------
[master] Port fix for http://java.net/jira/browse/GRIZZLY-1420 ;(Need a way to 
configure the timeout for blocking IO).


Revisions:
----------
58df60be0b978d84b755b720605a144b260c2a50


Modified Paths:
---------------
modules/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
modules/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
modules/grizzly/src/main/java/org/glassfish/grizzly/AbstractTransport.java
modules/grizzly/src/main/java/org/glassfish/grizzly/Transport.java
modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/TCPNIOTransport.java
modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOTransport.java
modules/grizzly/src/test/java/org/glassfish/grizzly/TCPNIOTransportTest.java
modules/grizzly/src/test/java/org/glassfish/grizzly/UDPNIOTransportTest.java


Diffs:
------
diff --git 
a/modules/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
 
b/modules/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
index 4e08534..224f5e8 100644
--- 
a/modules/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
+++ 
b/modules/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
@@ -268,7 +268,8 @@ public class GenericGrizzlyListener implements 
GrizzlyListener {
         final TCPNIOTransport tcpTransport = 
TCPNIOTransportBuilder.newInstance().build();
         
tcpTransport.setTcpNoDelay(Boolean.parseBoolean(transportConfig.getTcpNoDelay()));
         
tcpTransport.setLinger(Integer.parseInt(transportConfig.getLinger()));
-        
tcpTransport.setKeepAlive(Boolean.parseBoolean(transportConfig.getKeepAlive()));
+        
tcpTransport.setBlockingWriteTimeout(Long.parseLong(transportConfig.getWriteTimeoutMillis()),
 TimeUnit.MILLISECONDS);
+        
tcpTransport.setBlockingReadTimeout(Long.parseLong(transportConfig.getReadTimeoutMillis()),
 TimeUnit.MILLISECONDS);
         
tcpTransport.setServerConnectionBackLog(Integer.parseInt(transportConfig.getMaxConnectionsCount()));
         return tcpTransport;
     }
diff --git 
a/modules/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
 
b/modules/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
index 19ff4d0..90cefbe 100644
--- 
a/modules/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
+++ 
b/modules/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -65,6 +65,7 @@ public interface Transport extends ConfigBeanProxy, 
PropertyBag {
     int LINGER = -1;
     int MAX_CONNECTIONS_COUNT = 4096;
     int READ_TIMEOUT = 30000;
+    int WRITE_TIMEOUT = 30000;
     int SELECTOR_POLL_TIMEOUT = 1000;
     String BYTE_BUFFER_TYPE = "HEAP";
     String CLASSNAME = "org.glassfish.grizzly.nio.transport.TCPNIOTransport";
@@ -150,7 +151,7 @@ public interface Transport extends ConfigBeanProxy, 
PropertyBag {
     void setName(String value);
 
     /**
-     * Read operation timeout in ms
+     * Blocking read operation timeout in ms.
      */
     @Attribute(defaultValue = "" + READ_TIMEOUT, dataType = Integer.class)
     String getReadTimeoutMillis();
@@ -174,9 +175,9 @@ public interface Transport extends ConfigBeanProxy, 
PropertyBag {
     void setSelectorPollTimeoutMillis(String timeout);
 
     /**
-     * Write operation timeout in ms
+     * Blocking write operation timeout in ms.
      */
-    @Attribute(defaultValue = "" + READ_TIMEOUT, dataType = Integer.class)
+    @Attribute(defaultValue = "" + WRITE_TIMEOUT, dataType = Integer.class)
     String getWriteTimeoutMillis();
 
     void setWriteTimeoutMillis(String value);
diff --git 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/AbstractTransport.java 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/AbstractTransport.java
index 01fa829..5d36a88 100644
--- 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/AbstractTransport.java
+++ 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/AbstractTransport.java
@@ -42,6 +42,8 @@ package org.glassfish.grizzly;
 
 import java.io.IOException;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+
 import org.glassfish.grizzly.attributes.AttributeBuilder;
 import org.glassfish.grizzly.filterchain.FilterChain;
 import org.glassfish.grizzly.memory.MemoryManager;
@@ -113,6 +115,10 @@ public abstract class AbstractTransport implements 
Transport {
 
     protected boolean managedWorkerPool = true;
 
+    protected long writeTimeout = 
TimeUnit.MILLISECONDS.convert(DEFAULT_WRITE_TIMEOUT, TimeUnit.SECONDS);
+
+    protected long readTimeout = 
TimeUnit.MILLISECONDS.convert(DEFAULT_READ_TIMEOUT, TimeUnit.SECONDS);
+
     /**
      * Transport probes
      */
@@ -392,6 +398,54 @@ public abstract class AbstractTransport implements 
Transport {
      * {@inheritDoc}
      */
     @Override
+    public long getBlockingReadTimeout(TimeUnit timeUnit) {
+        if (readTimeout <= 0) {
+            return -1;
+        } else {
+            return timeUnit.convert(readTimeout, TimeUnit.MILLISECONDS);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setBlockingReadTimeout(long timeout, TimeUnit timeUnit) {
+        if (timeout <= 0) {
+            readTimeout = -1;
+        } else {
+            readTimeout = TimeUnit.MILLISECONDS.convert(timeout, timeUnit);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public long getBlockingWriteTimeout(TimeUnit timeUnit) {
+        if (writeTimeout <= 0) {
+            return -1;
+        } else {
+            return timeUnit.convert(writeTimeout, TimeUnit.MILLISECONDS);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setBlockingWriteTimeout(long timeout, TimeUnit timeUnit) {
+        if (timeout <= 0) {
+            writeTimeout = -1;
+        } else {
+            writeTimeout = TimeUnit.MILLISECONDS.convert(timeout, timeUnit);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public void fireEvent(final Event event,
             final Connection connection) {
 
@@ -414,7 +468,7 @@ public abstract class AbstractTransport implements 
Transport {
         ProcessorExecutor.execute(Context.create(connection,
                 conFilterChain, event, processingHandler));
     }
-    
+
     @Override
     public void notifyTransportError(final Throwable error) {
         notifyProbesError(this, error);
diff --git 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/Transport.java 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/Transport.java
index 3a54b07..ad65000 100644
--- a/modules/grizzly/src/main/java/org/glassfish/grizzly/Transport.java
+++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/Transport.java
@@ -42,6 +42,8 @@ package org.glassfish.grizzly;
 
 import java.io.IOException;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+
 import org.glassfish.grizzly.attributes.Attribute;
 import org.glassfish.grizzly.attributes.AttributeBuilder;
 import org.glassfish.grizzly.filterchain.FilterChain;
@@ -71,6 +73,17 @@ public interface Transport extends 
JmxMonitoringAware<TransportProbe> {
      * @since 2.2.8
      */
     static final int DEFAULT_READ_BUFFER_SIZE = 1024 * 64;
+
+    /**
+     * Default read timeout in seconds.
+     */
+    public static final int DEFAULT_READ_TIMEOUT = 30;
+
+    /**
+     * Default write timeout in seconds.
+     */
+    public static final int DEFAULT_WRITE_TIMEOUT = 30;
+
     
     enum State {STARTING, STARTED, PAUSING, PAUSED, STOPPING, STOPPED}
 
@@ -357,4 +370,53 @@ public interface Transport extends 
JmxMonitoringAware<TransportProbe> {
      * @param error {@link Throwable}.
      */
     void notifyTransportError(Throwable error);
+
+    /**
+     * Returns the current value for the read timeout converted to the 
provided
+     * {@link TimeUnit} specification.  If this value hasn't been explicitly
+     * set, it will default to {@value #DEFAULT_READ_TIMEOUT} seconds.
+     *
+     * @param timeUnit the {@link TimeUnit} to convert the returned result 
to.
+     *
+     * @since 2.3
+     */
+    long getBlockingReadTimeout(TimeUnit timeUnit);
+
+    /**
+     * Specifies the timeout for reads.  This may be overridden on a 
per-connection basis.
+     * A value of zero or less effectively disables the timeout.
+     *
+     * @param timeout the new timeout value
+     * @param timeUnit the {@TimeUnit} specification of the provided value.
+     *
+     * @see Connection#setBlockingReadTimeout(long, 
java.util.concurrent.TimeUnit)
+     *
+     * @since 3.0
+     */
+    void setBlockingReadTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Returns the current value for the write timeout converted to the 
provided
+     * {@link TimeUnit} specification.  If this value hasn't been explicitly
+     * set, it will default to {@value #DEFAULT_WRITE_TIMEOUT} seconds.
+     *
+     * @param timeUnit the {@link TimeUnit} to convert the returned result 
to.
+     *
+     * @since 3.0
+     */
+    long getBlockingWriteTimeout(TimeUnit timeUnit);
+
+    /**
+     * Specifies the timeout for writes.  This may be overridden on a 
per-connection basis.
+     * A value of zero or less effectively disables the timeout.
+     *
+     * @param timeout  the new timeout value
+     * @param timeUnit the {@TimeUnit} specification of the provided value.
+     *
+     * @see Connection#setBlockingWriteTimeout(long, 
java.util.concurrent.TimeUnit)
+     *
+     * @since 2.3
+     */
+    void setBlockingWriteTimeout(long timeout, TimeUnit timeUnit);
+
 }
diff --git 
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
index ece5949..3894a77 100644
--- 
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
@@ -158,7 +158,7 @@ public class TCPNIOTransport extends NIOTransport
      */
     private final TCPNIOConnectorHandler connectorHandler =
             new TransportConnectorHandler();
-    
+
     public TCPNIOTransport() {
         this(DEFAULT_TRANSPORT_NAME);
     }
@@ -198,7 +198,7 @@ public class TCPNIOTransport extends NIOTransport
             if (currentState != State.STOPPED) {
                 LOGGER.log(Level.WARNING,
                         
LogMessages.WARNING_GRIZZLY_TRANSPORT_NOT_STOP_STATE_EXCEPTION());
-                
+
                 return;
             }
 
@@ -439,12 +439,12 @@ public class TCPNIOTransport extends NIOTransport
         TCPNIOServerConnection serverConnection = null;
         final ServerSocketChannel serverSocketChannel =
                 selectorProvider.openServerSocketChannel();
-        
+
         final Lock lock = state.getStateLocker().writeLock();
         lock.lock();
         try {
             final ServerSocket serverSocket = serverSocketChannel.socket();
-            
+
             try {
                 serverSocket.setReuseAddress(reuseAddress);
             } catch (IOException e) {
@@ -458,7 +458,7 @@ public class TCPNIOTransport extends NIOTransport
                 LOGGER.log(Level.WARNING,
                         
LogMessages.WARNING_GRIZZLY_SOCKET_TIMEOUT_EXCEPTION(serverSocketSoTimeout), 
e);
             }
-            
+
 
             serverSocket.bind(socketAddress, backlog);
 
@@ -484,7 +484,7 @@ public class TCPNIOTransport extends NIOTransport
                 } catch (IOException ignored) {
                 }
             }
-            
+
             throw Exceptions.makeIOException(e);
         } finally {
             lock.unlock();
@@ -499,22 +499,22 @@ public class TCPNIOTransport extends NIOTransport
     public TCPNIOServerConnection bindToInherited() throws IOException {
         TCPNIOServerConnection serverConnection = null;
         final Channel inheritedChannel = System.inheritedChannel();
-        
+
         if (inheritedChannel == null) {
             throw new IOException("Inherited channel is not set");
         }
         if (!(inheritedChannel instanceof ServerSocketChannel)) {
             throw new IOException("Inherited channel is not 
java.nio.channels.ServerSocketChannel, but " + 
inheritedChannel.getClass().getName());
         }
-        
+
         final ServerSocketChannel serverSocketChannel = 
(ServerSocketChannel) inheritedChannel;
-        
+
         final Lock lock = state.getStateLocker().writeLock();
         lock.lock();
         try {
-            
+
             final ServerSocket serverSocket = serverSocketChannel.socket();
-            
+
             try {
                 serverSocket.setReuseAddress(reuseAddress);
             } catch (IOException e) {
@@ -528,7 +528,7 @@ public class TCPNIOTransport extends NIOTransport
                 LOGGER.log(Level.WARNING,
                         
LogMessages.WARNING_GRIZZLY_SOCKET_TIMEOUT_EXCEPTION(serverSocketSoTimeout), 
e);
             }
-            
+
             serverSocketChannel.configureBlocking(false);
 
             serverConnection = 
obtainServerNIOConnection(serverSocketChannel);
@@ -551,7 +551,7 @@ public class TCPNIOTransport extends NIOTransport
                 } catch (IOException ignored) {
                 }
             }
-            
+
             throw Exceptions.makeIOException(e);
         } finally {
             lock.unlock();
@@ -570,7 +570,7 @@ public class TCPNIOTransport extends NIOTransport
 
         final int lower = portRange.getLower();
         final int range = portRange.getUpper() - lower + 1;
-        
+
         int offset = RANDOM.nextInt(range);
         final int start = offset;
 
@@ -710,7 +710,7 @@ public class TCPNIOTransport extends NIOTransport
     @Override
     protected void closeConnection(final NIOConnection connection)
             throws IOException {
-        
+
         final SelectableChannel nioChannel = connection.getChannel();
 
         if (nioChannel != null) {
@@ -742,6 +742,8 @@ public class TCPNIOTransport extends NIOTransport
     void configureNIOConnection(final TCPNIOConnection connection) {
         connection.configureBlocking(isBlocking);
         connection.setFilterChain(filterChain);
+        connection.setBlockingReadTimeout(readTimeout, 
TimeUnit.MILLISECONDS);
+        connection.setBlockingWriteTimeout(writeTimeout, 
TimeUnit.MILLISECONDS);
         if (connectionMonitoringConfig.hasProbes()) {
             
connection.setMonitoringProbes(connectionMonitoringConfig.getProbes());
         }
@@ -779,7 +781,7 @@ public class TCPNIOTransport extends NIOTransport
             LOGGER.log(Level.WARNING,
                     
LogMessages.WARNING_GRIZZLY_SOCKET_TCPNODELAY_EXCEPTION(tcpNoDelay), e);
         }
-        
+
         try {
             socket.setReuseAddress(reuseAddress);
         } catch (IOException e) {
@@ -881,7 +883,7 @@ public class TCPNIOTransport extends NIOTransport
     protected Writer<SocketAddress> getWriter(final boolean isBlocking) {
         return super.getWriter(isBlocking);
     }
-    
+
     @Override
     protected final AbstractNIOAsyncQueueWriter getAsyncQueueWriter() {
         return asyncQueueWriter;
@@ -905,7 +907,7 @@ public class TCPNIOTransport extends NIOTransport
         ((TCPNIOConnection) connection).onConnect();
         return true;
     }
-//    
+//
 //    /**
 //     * {@inheritDoc}
 //     */
@@ -942,7 +944,7 @@ public class TCPNIOTransport extends NIOTransport
                 if (LOGGER.isLoggable(Level.FINE)) {
                     LOGGER.log(Level.FINE, "TCPNIOConnection (" + connection 
+ ") (allocated) read exception", e);
                 }
-                
+
                 read = -1;
             }
 
@@ -1028,7 +1030,7 @@ public class TCPNIOTransport extends NIOTransport
 
         return written;
     }
-    
+
     /**
      * {@inheritDoc}
      */
diff --git 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOTransport.java
 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOTransport.java
index b040ba9..6708650 100644
--- 
a/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOTransport.java
+++ 
b/modules/grizzly/src/main/java/org/glassfish/grizzly/nio/transport/UDPNIOTransport.java
@@ -215,7 +215,7 @@ public final class UDPNIOTransport extends NIOTransport 
implements
                 LOGGER.log(Level.WARNING,
                         
LogMessages.WARNING_GRIZZLY_SOCKET_TIMEOUT_EXCEPTION(serverSocketSoTimeout), 
e);
             }
-            
+
             socket.bind(socketAddress);
 
             serverDatagramChannel.configureBlocking(false);
@@ -249,7 +249,7 @@ public final class UDPNIOTransport extends NIOTransport 
implements
     @Override
     public Connection bindToInherited() throws IOException {
         final Channel inheritedChannel = System.inheritedChannel();
-        
+
         if (inheritedChannel == null) {
             throw new IOException("Inherited channel is not set");
         }
@@ -277,7 +277,7 @@ public final class UDPNIOTransport extends NIOTransport 
implements
                 LOGGER.log(Level.WARNING,
                         
LogMessages.WARNING_GRIZZLY_SOCKET_TIMEOUT_EXCEPTION(serverSocketSoTimeout), 
e);
             }
-            
+
             serverDatagramChannel.configureBlocking(false);
 
             serverConnection = 
obtainServerNIOConnection(serverDatagramChannel);
@@ -909,6 +909,8 @@ public final class UDPNIOTransport extends NIOTransport 
implements
     protected void configureNIOConnection(UDPNIOConnection connection) {
         connection.configureBlocking(isBlocking);
         connection.setFilterChain(filterChain);
+        connection.setBlockingReadTimeout(readTimeout, 
TimeUnit.MILLISECONDS);
+        connection.setBlockingWriteTimeout(writeTimeout, 
TimeUnit.MILLISECONDS);
         if (connectionMonitoringConfig.hasProbes()) {
             
connection.setMonitoringProbes(connectionMonitoringConfig.getProbes());
         }
diff --git 
a/modules/grizzly/src/test/java/org/glassfish/grizzly/TCPNIOTransportTest.java
 
b/modules/grizzly/src/test/java/org/glassfish/grizzly/TCPNIOTransportTest.java
index f706df7..9ac0151 100644
--- 
a/modules/grizzly/src/test/java/org/glassfish/grizzly/TCPNIOTransportTest.java
+++ 
b/modules/grizzly/src/test/java/org/glassfish/grizzly/TCPNIOTransportTest.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2008-2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -118,6 +118,19 @@ public class TCPNIOTransportTest extends GrizzlyTestCase 
{
         }
     }
 
+    public void testReadWriteTimeout() throws Exception {
+        TCPNIOTransport transport = 
TCPNIOTransportBuilder.newInstance().build();
+        assertEquals(30, 
transport.getBlockingWriteTimeout(TimeUnit.SECONDS));
+        assertEquals(30, transport.getBlockingReadTimeout(TimeUnit.SECONDS));
+        transport.setBlockingReadTimeout(45, TimeUnit.MINUTES);
+        assertEquals(TimeUnit.MILLISECONDS.convert(45, TimeUnit.MINUTES), 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+        assertEquals(30, 
transport.getBlockingWriteTimeout(TimeUnit.SECONDS));
+        transport.setBlockingReadTimeout(-5, TimeUnit.SECONDS);
+        assertEquals(-1, 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+        transport.setBlockingReadTimeout(0, TimeUnit.SECONDS);
+        assertEquals(-1, 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+    }
+
     public void testConnectorHandlerConnect() throws Exception {
         Connection connection = null;
         TCPNIOTransport transport = 
TCPNIOTransportBuilder.newInstance().build();
diff --git 
a/modules/grizzly/src/test/java/org/glassfish/grizzly/UDPNIOTransportTest.java
 
b/modules/grizzly/src/test/java/org/glassfish/grizzly/UDPNIOTransportTest.java
index ff7087f..33dc299 100644
--- 
a/modules/grizzly/src/test/java/org/glassfish/grizzly/UDPNIOTransportTest.java
+++ 
b/modules/grizzly/src/test/java/org/glassfish/grizzly/UDPNIOTransportTest.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -97,6 +97,19 @@ public class UDPNIOTransportTest extends GrizzlyTestCase {
         }
     }
 
+    public void testReadWriteTimeout() throws Exception {
+        UDPNIOTransport transport = 
UDPNIOTransportBuilder.newInstance().build();
+        assertEquals(30, 
transport.getBlockingWriteTimeout(TimeUnit.SECONDS));
+        assertEquals(30, transport.getBlockingReadTimeout(TimeUnit.SECONDS));
+        transport.setBlockingReadTimeout(45, TimeUnit.MINUTES);
+        assertEquals(TimeUnit.MILLISECONDS.convert(45, TimeUnit.MINUTES), 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+        assertEquals(30, 
transport.getBlockingWriteTimeout(TimeUnit.SECONDS));
+        transport.setBlockingReadTimeout(-5, TimeUnit.SECONDS);
+        assertEquals(-1, 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+        transport.setBlockingReadTimeout(0, TimeUnit.SECONDS);
+        assertEquals(-1, 
transport.getBlockingReadTimeout(TimeUnit.MILLISECONDS));
+    }
+
     public void testPortRangeBind() throws Exception {
         final int portsTest = 10;
         final PortRange portRange = new PortRange(PORT, PORT + portsTest - 
1);




[grizzly~git:58df60be] [master] Port fix for http://java.net/jira/browse/GRIZZLY-1420 (Need a wa

rlubke 02/01/2013
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close