Class SocketLogging


  • public class SocketLogging
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.net.ServerSocket ss  
    • Constructor Summary

      Constructors 
      Constructor Description
      SocketLogging​(int port)
      builds the server socket
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void logToPrintStream​(java.io.PrintStream out, java.lang.String addOn)
      get the logging data from the socket print data to the stream add a new line character if told to repeat
      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
    • Field Detail

      • ss

        java.net.ServerSocket ss
    • Constructor Detail

      • SocketLogging

        public SocketLogging​(int port)
                      throws java.io.IOException
        builds the server socket
        Parameters:
        port - ip port to talk with server
        Throws:
        java.io.IOException - - any number of socket errors
    • Method Detail

      • main

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

        public void logToPrintStream​(java.io.PrintStream out,
                                     java.lang.String addOn)
                              throws java.io.IOException
        get the logging data from the socket print data to the stream add a new line character if told to repeat
        Parameters:
        out - - PrintStream object to log to
        addOn - - after each logging event add a new line ?
        Throws:
        java.io.IOException - - socket or io errors are possible
      • close

        public void close()