Dart API Referencedart:ioServerSocket

ServerSocket Interface

Constructors

Code new ServerSocket(String bindAddress, int port, int backlog) #

Constructs a new server socket, binds it to a given address and port, and listens on it.

ServerSocket(String bindAddress, int port, int backlog);

Methods

Code void close() #

Closes the socket.

void close();

Code 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));

Code void set onError(void callback(e)) #

The error handler gets called when a socket error occurs.

void set onError(void callback(e));

Code int get port() #

Returns the port used by this socket.

int get port();