Class TcpSender

java.lang.Object
org.apache.catalina.ha.backend.TcpSender
All Implemented Interfaces:
Sender

public class TcpSender extends Object implements Sender
TCP-based sender for sending heartbeat messages to proxy servers.
  • Field Details

    • proxies

      protected Proxy[] proxies
      Proxies.
    • connections

      protected Socket[] connections
      Active socket connections to proxies.
    • connectionReaders

      protected BufferedReader[] connectionReaders
      Readers for active connections.
    • connectionWriters

      protected BufferedWriter[] connectionWriters
      Writers for active connections.
  • Constructor Details

    • TcpSender

      public TcpSender()
      Constructs a new TcpSender.
  • Method Details

    • init

      public void init(HeartbeatListener config) throws Exception
      Description copied from interface: Sender
      Set the configuration parameters
      Specified by:
      init in interface Sender
      Parameters:
      config - The heartbeat listener configuration
      Throws:
      Exception - An error occurred
    • send

      public int send(String mess) throws Exception
      Description copied from interface: Sender
      Send the message to the proxies
      Specified by:
      send in interface Sender
      Parameters:
      mess - The message that will be sent
      Returns:
      0 if no error occurred, -1 otherwise
      Throws:
      Exception - An error occurred
    • close

      protected void close(int i)
      Close connection.
      Parameters:
      i - The index of the connection that will be closed