BioSender (Apache Tomcat 9.0.37 API Documentation)

org.apache.catalina.tribes.transport.bio

## Class BioSender

- java.lang.Object
- - org.apache.catalina.tribes.transport.AbstractSender
  - - org.apache.catalina.tribes.transport.bio.BioSender

- All Implemented Interfaces:
    DataSender

  Deprecated.
  This will be removed in Tomcat 10

      @Deprecated
      public class BioSender
      extends AbstractSender

  Send cluster messages with only one socket. Ack and keep Alive Handling is supported
  Since:
    5.5.16
  Author:
    Peter Rossbach

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected XByteBuffer` | `ackbuf` Deprecated.
    `protected static StringManager` | `sm` Deprecated. The string manager for this package.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BioSender()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `closeSocket()` Deprecated. Close socket.
    `void` | `connect()` Deprecated. Connect other cluster member receiver
    `void` | `disconnect()` Deprecated. disconnect and close socket
    `protected void` | `openSocket()` Deprecated. Open real socket and set time out when waitForAck is enabled is socket open return directly.
    `protected void` | `pushMessage(byte[] data, boolean reconnect, boolean waitForAck)` Deprecated. Push messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed.
    `void` | `sendMessage(byte[] data, boolean waitForAck)` Deprecated. Send message.
    `String` | `toString()` Deprecated.
    `protected void` | `waitForAck()` Deprecated. Wait for Acknowledgement from other server.

    - ### Methods inherited from class org.apache.catalina.tribes.transport.AbstractSender

      `getAddress, getAttempt, getConnectTime, getDestination, getDirectBuffer, getKeepAliveCount, getKeepAliveTime, getMaxRetryAttempts, getOoBInline, getPort, getRequestCount, getRxBufSize, getSoKeepAlive, getSoLingerOn, getSoLingerTime, getSoReuseAddress, getSoTrafficClass, getTcpNoDelay, getThrowOnFailedAck, getTimeout, getTxBufSize, getUdpPort, getUdpRxBufSize, getUdpTxBufSize, isConnected, isUdpBased, keepalive, setAddress, setAttempt, setConnected, setConnectTime, setDestination, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, setUdpBased, setUdpPort, setUdpRxBufSize, setUdpTxBufSize, transferProperties`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### sm

          protected static final StringManager sm

      Deprecated.
      The string manager for this package.

    - #### ackbuf

          protected final XByteBuffer ackbuf

      Deprecated.

  - ### Constructor Detail

    - #### BioSender

          public BioSender()

      Deprecated.

  - ### Method Detail

    - #### connect

          public void connect()
                       throws IOException

      Deprecated.
      Connect other cluster member receiver
      Specified by:
        `connect` in interface `DataSender`
      Specified by:
        `connect` in class `AbstractSender`
      Throws:
        `IOException` - TODO Implement this org.apache.catalina.tribes.transport.DataSender method
      See Also:
        `DataSender.connect()`

    - #### disconnect

          public void disconnect()

      Deprecated.
      disconnect and close socket
      Specified by:
        `disconnect` in interface `DataSender`
      Specified by:
        `disconnect` in class `AbstractSender`
      See Also:
        `DataSender.disconnect()`

    - #### sendMessage

          public void sendMessage(byte[] data,
                                  boolean waitForAck)
                           throws IOException

      Deprecated.
      Send message.
      Parameters:
        `data` - The data to send
        `waitForAck` - Wait for an ack
      Throws:
        `IOException` - An IO error occurred sending the message

    - #### toString

          public String toString()

      Deprecated.
      Overrides:
        `toString` in class `Object`

    - #### openSocket

          protected void openSocket()
                             throws IOException

      Deprecated.
      Open real socket and set time out when waitForAck is enabled is socket open return directly.
      Throws:
        `IOException` - Error opening socket

    - #### closeSocket

          protected void closeSocket()

      Deprecated.
      Close socket.
      See Also:
        `disconnect()`

    - #### pushMessage

          protected void pushMessage(byte[] data,
                                     boolean reconnect,
                                     boolean waitForAck)
                              throws IOException

      Deprecated.
      Push messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed. After sending error close and reopen socket again. After successful sending update stats WARNING: Subclasses must be very careful that only one thread call this pushMessage at once!!!
      Parameters:
        `data` - Data to send
        `reconnect` - Do a reconnect (close socket then reopen)
        `waitForAck` - Wait for an acknowledgement
      Throws:
        `IOException` - IO error writing data
      Since:
        5.5.10
      See Also:
        `closeSocket()`, `openSocket()`, `sendMessage(byte[], boolean)`

    - #### waitForAck

          protected void waitForAck()
                             throws IOException

      Deprecated.
      Wait for Acknowledgement from other server. FIXME Please, not wait only for three characters, better control that the wait ack message is correct.
      Throws:
        `IOException` - An IO error occurred

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.