Network utilities.

Static methods

staticcreateConnection (options:SocketCreationOptions, ?cb:Callback<NoData>):Socket

Constructs a socket with the given options. If options.connect is given, an appropriate connect method is called on the socket. If cb is given, it is passed to the connect method, so it will be called once the socket successfully connects or an error occurs during connecting.

The options object is given both to the Socket constructor and to the connect method.

staticcreateServer (?options:ServerCreationOptions, ?listener:Listener<Socket>):Server

Constructs a server with the given options. If options.listen is given, an appropriate listen method is called on the server. If cb is given, it is passed to the listen method, so it will be called for each client that connects to the server.

The options object is given both to the Server constructor and to the listen method.