PeerServer (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.net, interface: PeerServer

Package org.apache.hadoop.hdfs.net

# Interface PeerServer

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `DomainPeerServer`, `TcpPeerServer`

@Private public interface PeerServer extends Closeable

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.apache.hadoop.hdfs.net.Peer`
  `accept()`
  Listens for a connection to be made to this server and accepts it.
  `void`
  `close()`
  Free the resources associated with this peer server.
  `String`
  `getListeningString()`
  `int`
  `getReceiveBufferSize()`
  Get the receive buffer size of the PeerServer.
  `void`
  `setReceiveBufferSize(int size)`
  Set the receive buffer size of the PeerServer.

- ## Method Details

  - ### setReceiveBufferSize

    void setReceiveBufferSize(int size) throws IOException
    Set the receive buffer size of the PeerServer.
    Parameters:
      `size` - The receive buffer size.
    Throws:
      `IOException`

  - ### getReceiveBufferSize

    int getReceiveBufferSize() throws IOException
    Get the receive buffer size of the PeerServer.
    Returns:
      The receive buffer size.
    Throws:
      `IOException`

  - ### accept

    org.apache.hadoop.hdfs.net.Peer accept() throws IOException, SocketTimeoutException
    Listens for a connection to be made to this server and accepts it. The method blocks until a connection is made.
    Throws:
      `IOException` - if an I/O error occurs when waiting for a connection.
      `SecurityException` - if a security manager exists and its `checkAccept` method doesn't allow the operation.
      `SocketTimeoutException` - if a timeout was previously set and the timeout has been reached.

  - ### getListeningString

    String getListeningString()
    Returns:
      A string representation of the address we're listening on.

  - ### close

    void close() throws IOException
    Free the resources associated with this peer server. This normally includes sockets, etc.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException` - If there is an error closing the PeerServer