Class EchoServer


  • public class EchoServer
    extends java.lang.Object
    Simple TCP server replying back to client with connection information (peer address etc)
    Since:
    4.1.8
    Author:
    Bela Ban
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String name  
      protected java.net.ServerSocket srv_sock  
      protected java.util.concurrent.ExecutorService thread_pool  
    • Constructor Summary

      Constructors 
      Constructor Description
      EchoServer()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      protected void start​(java.net.InetAddress bind_addr, int port)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • srv_sock

        protected java.net.ServerSocket srv_sock
      • thread_pool

        protected java.util.concurrent.ExecutorService thread_pool
      • name

        protected final java.lang.String name
    • Constructor Detail

      • EchoServer

        public EchoServer()
    • Method Detail

      • start

        protected void start​(java.net.InetAddress bind_addr,
                             int port)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception