[Commits] Rev 414: CONJ-27 : Implement tcpAbortiveClose option, for "hard" socket closing. in file:///H:/bzr/mariadb-java-client/

Vladislav Vaintroub wlad at montyprogram.com
Thu Feb 28 00:18:17 EET 2013


At file:///H:/bzr/mariadb-java-client/

------------------------------------------------------------
revno: 414
revision-id: wlad at montyprogram.com-20130227221731-4f9dqwhepdsbekfq
parent: wlad at montyprogram.com-20130227220007-ffjtff8f0hia7nj5
committer: Vladislav Vaintroub <wlad at montyprogram.com>
branch nick: mariadb-java-client
timestamp: Wed 2013-02-27 23:17:31 +0100
message:
  CONJ-27 : Implement tcpAbortiveClose option, for "hard" socket closing. 
  
  If set, client will abort connection in a way that TCP connection does not enter usual TCP_WAIT state upon close, and free local port. This option can be handy in situation where connections are created and destroyed in rapid succession and new connection can't be created because of port shortage.
-------------- next part --------------
=== modified file 'src/main/java/org/mariadb/jdbc/internal/mysql/MySQLProtocol.java'
--- a/src/main/java/org/mariadb/jdbc/internal/mysql/MySQLProtocol.java	2013-02-14 21:32:33 +0000
+++ b/src/main/java/org/mariadb/jdbc/internal/mysql/MySQLProtocol.java	2013-02-27 22:17:31 +0000
@@ -266,8 +266,8 @@ public class MySQLProtocol implements Pr
             String value = info.getProperty("tcpNoDelay", "false");
             if (value.equalsIgnoreCase("true"))
                 socket.setTcpNoDelay(true);
+            
             value = info.getProperty("tcpKeepAlive", "false");
-
             if (value.equalsIgnoreCase("true"))
                 socket.setKeepAlive(true);
 
@@ -278,6 +278,11 @@ public class MySQLProtocol implements Pr
             value = info.getProperty("tcpSndBuf");
             if (value != null)
                 socket.setSendBufferSize(Integer.parseInt(value));
+            
+            value = info.getProperty("tcpAbortiveClose","false");
+            if (value.equalsIgnoreCase("true"))
+                socket.setSoLinger(true, 0);
+                
        } catch (Exception e) {
             log.finest("Failed to set socket option: " + e.getLocalizedMessage());
        }



More information about the commits mailing list