Klasse Server

java.lang.Object
ch.nolix.core.net.endpoint.BaseServer
ch.nolix.core.net.endpoint.Server
Alle implementierten Schnittstellen:
IServer, Closeable, CloseStateRequestable, GroupCloseable, Clearable, EmptinessRequestable, AutoCloseable

public final class Server extends BaseServer
A Server is a BaseServer that listens to NetEndPoint on a specific port. A Server supports the WebSocket protocol and can communicate with a WebSocket.
Version:
2016-01-01
Autor:
Silvan Wyss
  • Felddetails

  • Methodendetails

    • forHttpPort

      public static Server forHttpPort()
      Gibt zurück:
      a new Server that will listen to NetEndPoints on the HTTP port (80).
    • forPort

      public static Server forPort(int port)
      Parameter:
      port -
      Gibt zurück:
      a new Server that will listen to NetEndPoints on the given port.
      Löst aus:
      ArgumentIsOutOfRangeException - if the given port is not in [0, 65535].
    • forPortAndInitialHttpMessage

      public static Server forPortAndInitialHttpMessage(int port, String initialHttpMessage)
      Parameter:
      port -
      initialHttpMessage -
      Gibt zurück:
      a new Server that will listen to NetEndPoints on the given port. When a web browser connects to the Server, the Server will send the given initialHttpMessage to the web browser and close the connection.
      Löst aus:
      ArgumentIsOutOfRangeException - if the given port is not in [0, 65535].
      ArgumentIsNullException - if the given initialHttpMessage is null.
      InvalidArgumentException - if the given initialHttpMessage is blank.
    • getInitialHttpMessage

      public String getInitialHttpMessage()
      The HTTP message of a Server is the message a Server sends to web browsers.
      Gibt zurück:
      the initial HTTP message the current Server will send to web browsers.
    • getPort

      public int getPort()
      Gibt zurück:
      the port of the current Server.
    • getSecurityMode

      public SecurityMode getSecurityMode()
    • noteClose

      public void noteClose()
      Lets the current GroupCloseable note a close.