Package examples.unix

Class echo


  • public final class echo
    extends java.lang.Object
    This is an example program demonstrating how to use the EchoTCPClient and EchoUDPClient classes. This program connects to the default echo service port of a specified server, then reads lines from standard input, writing them to the echo server, and then printing the echo. The default is to use the TCP port. Use the -udp flag to use the UDP port.

    Usage: echo [-udp]

    • Constructor Summary

      Constructors 
      Constructor Description
      echo()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void echoTCP​(java.lang.String host)  
      static void echoUDP​(java.lang.String host)  
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

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

      • echo

        public echo()
    • Method Detail

      • echoTCP

        public static final void echoTCP​(java.lang.String host)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • echoUDP

        public static final void echoUDP​(java.lang.String host)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)