ServerSocket abstract class
abstract class ServerSocket { /** * Constructs a new server socket, binds it to a given address and port, * and listens on it. */ factory ServerSocket(String bindAddress, int port, int backlog) { return new _ServerSocket(bindAddress, port, backlog); } /** * The connection handler gets called when there is a new incoming * connection on the socket. */ void set onConnection(void callback(Socket connection)); /** * The error handler gets called when a socket error occurs. */ void set onError(void callback(e)); /** * Returns the port used by this socket. */ int get port; /** * Closes the socket. */ void close(); }
Constructors
Properties
void set onConnection(void callback(Socket connection)) #
The connection handler gets called when there is a new incoming connection on the socket.
void set onConnection(void callback(Socket connection));
void set onError(void callback(e)) #
The error handler gets called when a socket error occurs.
void set onError(void callback(e));
Methods
void close() #
Closes the socket.
void close();