Class SocketMessage


  • public final class SocketMessage
    extends Object
    Starts up a server socket on the given port, and listens for messages sent to it. Sends the contents of the message to anyone who is registered as a listener.
    • Constructor Detail

      • SocketMessage

        public SocketMessage​(int port,
                             String message)
        Try to start a listener on the given port. If that port is already used, send the given message to it.
        Parameters:
        port - listen on this server port.
        message - send this message if port in use
    • Method Detail

      • setRaw

        public void setRaw​(boolean raw)
      • isAlreadyRunning

        public boolean isAlreadyRunning()
        Was the port already in use?
        Returns:
        true if the port was already in use
      • removeEventListener

        public void removeEventListener​(SocketMessage.EventListener l)
        Remove an EventListener.
        Parameters:
        l - the listener