Class Ping


  • public class Ping
    extends java.lang.Object
    Example showing kilim's support for NIO. Usage: java kilim.examples.Ping -server in one window and java kilim.examples.Ping -client in one or more windows. The client sends a number of 100 byte packets which are then echoed by the server.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Ping.Client
      The Client is a conventional Java socket application.
      static class  Ping.Server
      Server is a SessionTask, which means an instance of it is created by the NioSelectorScheduler on an incoming connection.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int PACKET_LEN  
      (package private) static int port  
      (package private) static boolean server  
    • Constructor Summary

      Constructors 
      Constructor Description
      Ping()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      (package private) static void parsePort​(java.lang.String portstr)  
      private static void usage()  
      • Methods inherited from class java.lang.Object

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

      • PACKET_LEN

        static int PACKET_LEN
      • server

        static boolean server
      • port

        static int port
    • Constructor Detail

      • Ping

        public Ping()
    • Method Detail

      • main

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

        private static void usage()
      • parsePort

        static void parsePort​(java.lang.String portstr)