SimpleTcpServer (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.oncrpc, class: SimpleTcpServer

Package org.apache.hadoop.oncrpc

# Class SimpleTcpServer

java.lang.Object
org.apache.hadoop.oncrpc.SimpleTcpServer

public class SimpleTcpServer extends Object
Simple UDP server implemented using netty.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `boundPort`
  `static final org.slf4j.Logger`
  `LOG`
  `protected final int`
  `port`
  `protected final io.netty.channel.ChannelInboundHandlerAdapter`
  `rpcProgram`
  `protected final int`
  `workerCount`
  The maximum number of I/O worker threads

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleTcpServer(int port, RpcProgram program, int workercount)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBoundPort()`
  `void`
  `run()`
  `void`
  `shutdown()`

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

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

- ## Field Details

  - ### LOG

    public static final org.slf4j.Logger LOG

  - ### port

    protected final int port

  - ### boundPort

    protected int boundPort

  - ### rpcProgram

    protected final io.netty.channel.ChannelInboundHandlerAdapter rpcProgram

  - ### workerCount

    protected final int workerCount
    The maximum number of I/O worker threads

- ## Constructor Details

  - ### SimpleTcpServer

    public SimpleTcpServer(int port, RpcProgram program, int workercount)
    Parameters:
      `port` - TCP port where to start the server at
      `program` - RPC program corresponding to the server
      `workercount` - Number of worker threads

- ## Method Details

  - ### run

    public void run() throws InterruptedException
    Throws:
      `InterruptedException`

  - ### getBoundPort

    public int getBoundPort()

  - ### shutdown

    public void shutdown()