tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1724544 - /tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
Date Thu, 14 Jan 2016 07:55:14 GMT
Author: kfujino
Date: Thu Jan 14 07:55:14 2016
New Revision: 1724544

URL: http://svn.apache.org/viewvc?rev=1724544&view=rev
Log:
Refactoring: Remove unused code in NonBlockingCoordinator.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java?rev=1724544&r1=1724543&r2=1724544&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
Thu Jan 14 07:55:14 2016
@@ -292,38 +292,17 @@ public class NonBlockingCoordinator exte
     }
 
     protected boolean alive(Member mbr) {
-        return memberAlive(mbr, COORD_ALIVE, false, false,
-                waitForCoordMsgTimeout, waitForCoordMsgTimeout, getOptionFlag());
+        return memberAlive(mbr, COORD_ALIVE, waitForCoordMsgTimeout);
     }
 
-    protected boolean memberAlive(Member mbr, byte[] msgData,
-                                         boolean sendTest, boolean readTest,
-                                         long readTimeout, long conTimeout,
-                                         int optionFlag) {
+    protected boolean memberAlive(Member mbr, byte[] msgData,long conTimeout) {
         //could be a shutdown notification
         if ( Arrays.equals(mbr.getCommand(),Member.SHUTDOWN_PAYLOAD) ) return false;
 
         try (Socket socket = new Socket()) {
             InetAddress ia = InetAddress.getByAddress(mbr.getHost());
             InetSocketAddress addr = new InetSocketAddress(ia, mbr.getPort());
-            socket.setSoTimeout((int)readTimeout);
             socket.connect(addr, (int) conTimeout);
-            if ( sendTest ) {
-                ChannelData data = new ChannelData(true);
-                data.setAddress(mbr);
-                data.setMessage(new XByteBuffer(msgData,false));
-                data.setTimestamp(System.currentTimeMillis());
-                int options = optionFlag | Channel.SEND_OPTIONS_BYTE_MESSAGE;
-                if ( readTest ) options = (options | Channel.SEND_OPTIONS_USE_ACK);
-                else options = (options & (~Channel.SEND_OPTIONS_USE_ACK));
-                data.setOptions(options);
-                byte[] message = XByteBuffer.createDataPackage(data);
-                socket.getOutputStream().write(message);
-                if ( readTest ) {
-                    int length = socket.getInputStream().read(message);
-                    return length > 0;
-                }
-            }//end if
             return true;
         } catch (SocketTimeoutException sx) {
             //do nothing, we couldn't connect



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message