Skip to content
Michael Barrett edited this page Sep 6, 2015 · 3 revisions

The Server class represents the actual networking server that will allow incoming connections to be made. It takes connections from Client objects and passes them into a ClientManager

Instance

new Server(Function<Client> connectionHandler) -> Server

Creates a new server instance and registers a callback function for when a Client connects to the server. The server will construct a Client instance and pass it into the handler. Typically you will want to immediately put the Client into a ClientManager

.listen(Number port, Function callback)

Begins listening on the given port. Runs callback when the server is online.

Clone this wiki locally