@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override protected void doTask(Channel channel) { try { Long lastRead = lastRead(channel); Long now = now(); // Rely on reconnect timer to reconnect when AbstractClient.doConnect fails to init the connection if (!channel.isConnected()) { try { logger.info("Initial connection to " + channel); ((Client) channel).reconnect(); } catch (Exception e) { logger.error("Fail to connect to " + channel, e); } // check pong at client } else if (lastRead != null && now - lastRead > idleTimeout) { logger.warn("Reconnect to channel " + channel + ", because heartbeat read idle time out: " + idleTimeout + "ms"); try { ((Client) channel).reconnect(); } catch (Exception e) { logger.error(channel + "reconnect failed during idle time.", e); } } } catch (Throwable t) { logger.warn("Exception when reconnect to remote channel " + channel.getRemoteAddress(), t); } } }
@Override protected void doTask(Channel channel) { try { Long lastRead = lastRead(channel); Long now = now(); // Rely on reconnect timer to reconnect when AbstractClient.doConnect fails to init the connection if (!channel.isConnected()) { try { logger.info("Initial connection to " + channel); ((Client) channel).reconnect(); } catch (Exception e) { logger.error("Fail to connect to " + channel, e); } // check pong at client } else if (lastRead != null && now - lastRead > idleTimeout) { logger.warn("Reconnect to channel " + channel + ", because heartbeat read idle time out: " + idleTimeout + "ms"); try { ((Client) channel).reconnect(); } catch (Exception e) { logger.error(channel + "reconnect failed during idle time.", e); } } } catch (Throwable t) { logger.warn("Exception when reconnect to remote channel " + channel.getRemoteAddress(), t); } } }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override public void reconnect() throws RemotingException { client.reconnect(); }
@Override protected void doTask(Channel channel) { try { Long lastRead = lastRead(channel); Long now = now(); if (lastRead != null && now - lastRead > heartbeatTimeout) { logger.warn("Close channel " + channel + ", because heartbeat read idle time out: " + heartbeatTimeout + "ms"); if (channel instanceof Client) { try { ((Client) channel).reconnect(); } catch (Exception e) { //do nothing } } else { channel.close(); } } } catch (Throwable t) { logger.warn("Exception when reconnect to remote channel " + channel.getRemoteAddress(), t); } } }
@Override protected void doTask(Channel channel) { try { Long lastRead = lastRead(channel); Long now = now(); if (lastRead != null && now - lastRead > heartbeatTimeout) { logger.warn("Close channel " + channel + ", because heartbeat read idle time out: " + heartbeatTimeout + "ms"); if (channel instanceof Client) { try { ((Client) channel).reconnect(); } catch (Exception e) { //do nothing } } else { channel.close(); } } } catch (Throwable t) { logger.warn("Exception when reconnect to remote channel " + channel.getRemoteAddress(), t); } } }