Source:
synchronized boolean connectOne(long sid, MultipleAddresses electionAddr) { if (senderWorkerMap.get(sid) != null) { LOG.debug("There is a connection already for server {}", sid); if (electionAddr.size() > 1 && self.isMultiAddressEnabled() && self.isMultiAddressReachabilityCheckEnabled()) { senderWorkerMap.get(sid).asyncValidateIfSocketIsStillReachable(); } return true; } Socket sock = null; try { LOG.debug("Opening channel to server {}", sid); if (self.isSslQuorum()) { sock = self.getX509Util().createSSLSocket(); } else { sock = new Socket(); } setSockOpts(sock); sock.connect(electionAddr.getReachableOrOne(), cnxTO); if (sock instanceof SSLSocket) { SSLSocket sslSock = (SSLSocket) sock; sslSock.startHandshake(); LOG.info("SSL handshake complete with - - {}", sslSock.getRemoteSocketAddress(), sslSock.getSession().getProtocol(), sslSock.getSession().getCipherSuite()); } LOG.debug("Connected to server using election address: {}:{}", sid, sock.getInetAddress(), sock.getPort()); if (quorumSaslAuthEnabled) { initiateConnectionAsync(sock, sid); } else { initiateConnection(sock, sid); } return true; } catch (UnresolvedAddressException e) { LOG.warn("Cannot open channel to at election address {}", sid, electionAddr, e); closeSocket(sock); throw e; } catch (X509Exception e) { LOG.warn("Cannot open secure channel to at election address {}", sid, electionAddr, e); closeSocket(sock); return false; } catch (NoRouteToHostException e) { LOG.warn("None of the addresses ({}) are reachable for sid {}", electionAddr, sid, e); closeSocket(sock); return false; } catch (IOException e) { LOG.warn("Cannot open channel to at election address {}", sid, electionAddr, e); closeSocket(sock); return false; } }

Target:
synchronized boolean connectOne(long sid, MultipleAddresses electionAddr) { if (senderWorkerMap.get(sid) != null) { LOG.debug("There is a connection already for server {}", sid); if (self.isMultiAddressEnabled() && electionAddr.size() > 1 && self.isMultiAddressReachabilityCheckEnabled()) { senderWorkerMap.get(sid).asyncValidateIfSocketIsStillReachable(); } return true; } Socket sock = null; try { LOG.debug("Opening channel to server {}", sid); if (self.isSslQuorum()) { sock = self.getX509Util().createSSLSocket(); } else { sock = new Socket(); } setSockOpts(sock); sock.connect(electionAddr.getReachableOrOne(), cnxTO); if (sock instanceof SSLSocket) { SSLSocket sslSock = (SSLSocket) sock; sslSock.startHandshake(); LOG.info("SSL handshake complete with - - {}", sslSock.getRemoteSocketAddress(), sslSock.getSession().getProtocol(), sslSock.getSession().getCipherSuite()); } LOG.debug("Connected to server using election address: {}:{}", sid, sock.getInetAddress(), sock.getPort()); if (quorumSaslAuthEnabled) { initiateConnectionAsync(sock, sid); } else { initiateConnection(sock, sid); } return true; } catch (UnresolvedAddressException e) { LOG.warn("Cannot open channel to at election address {}", sid, electionAddr, e); closeSocket(sock); throw e; } catch (X509Exception e) { LOG.warn("Cannot open secure channel to at election address {}", sid, electionAddr, e); closeSocket(sock); return false; } catch (NoRouteToHostException e) { LOG.warn("None of the addresses ({}) are reachable for sid {}", electionAddr, sid, e); closeSocket(sock); return false; } catch (IOException e) { LOG.warn("Cannot open channel to at election address {}", sid, electionAddr, e); closeSocket(sock); return false; } }