Klasse Server
java.lang.Object
ch.nolix.core.net.endpoint.AbstractServer
ch.nolix.core.net.endpoint.Server
- Alle implementierten Schnittstellen:
IServer, Closeable, CloseStateRequestable, GroupCloseable, Clearable, EmptinessRequestable, AutoCloseable
A
Server is a AbstractServer that listens to
AbstractNetEndPoint on a specific port.
A Server supports the WebSocket protocol and can communicate with a
WebSocket.- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic Serverstatic ServerforPort(int port) static ServerforPortAndInitialHttpMessage(int port, String initialHttpMessage) intgetPort()voidLets the currentGroupCloseablenote a close.Von Klasse geerbte Methoden AbstractServer
addDefaultSlot, addSlot, clear, containsDefaultSlot, containsSlotWithName, getStoredCloseController, isEmpty, removeSlotByNameVon Klasse geerbte Methoden Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden CloseStateRequestable
isOpenVon Schnittstelle geerbte Methoden EmptinessRequestable
containsAnyVon Schnittstelle geerbte Methoden GroupCloseable
close, createCloseDependencyTo, isClosed
-
Felddetails
-
DEFAULT_INITIAL_HTTP_MESSAGE
- Siehe auch:
-
-
Methodendetails
-
forHttpPort
- Gibt zurück:
- a new
Serverthat will listen toAbstractNetEndPoints on the HTTP port (80).
-
forPort
- Parameter:
port-- Gibt zurück:
- a new
Serverthat will listen toAbstractNetEndPoints on the given port. - Löst aus:
ArgumentIsOutOfRangeException- if the given port is not in [0, 65535].
-
forPortAndInitialHttpMessage
- Parameter:
port-initialHttpMessage-- Gibt zurück:
- a new
Serverthat will listen toAbstractNetEndPoints on the given port. When a web browser connects to theServer, theServerwill 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
-
getPort
public int getPort()- Gibt zurück:
- the port of the current
Server.
-
getSecurityMode
-
noteClose
public void noteClose()Lets the currentGroupCloseablenote a close.
-