Represents a TCP or SSL server
If an instance is instantiated from an event loop then the handlers of the instance will always be called on that same event loop. If an instance is instantiated from some other arbitrary Java thread (i.e. when running embedded) then and event loop will be assigned to the instance and used when any of its handlers are called.
Instances of this class are thread-safe.
Anything
NetServer
ServerBase
NetworkBase
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
NetServer(NetServer delegate) |
Inherited Attributes |
Attributes inherited from: NetworkBase |
Attributes inherited from: Object hash , string |
Attributes inherited from: ServerBase |
Methods | |
close | shared Promise<Anything> close() Close the server. This will close any currently open connections. The returned promise will be resolved when the close is complete. |
connectHandler | shared NetServer connectHandler(void onConnect(NetSocket sock)) Supply a connect handler for this server. The server can only have at most one connect handler at any one time.
As the server accepts TCP or SSL connections it creates an instance of |
listen | shared Promise<NetServer> listen(Integer port, String? host = null) |
Inherited Methods |
Methods inherited from: Object equals |