Virtual Serial Port Tools - Advanced serial port configurations for your custom ports usage scenario
Download Virtual Serial Port Tools Hide this button

ITcpListener Interface

This interface is implemented by a TCP listener object. Use the INetworkManager.createTcpListener method to create one.

Declaration

interface ITcpListener {

    // Methods
    ${bind}(port: number): Promise<void>;
    ${bind#bind1}(host: string, port: number): Promise<void>;
    ${listen}(): Promise<${ITcpSocket}>;
}
// This interface is not available in managed environment
// This interface is not available in native environment

ITcpListener Methods

bind

bind(port: number): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
port
Local TCP port number.

Bind a TCP listener to a given local TCP port on all local interfaces.

bind

bind(host: string, port: number): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
host
Local host name/address.
port
Local TCP port number.

Bind a TCP listener to a given local endpoint.

listen

listen(): Promise<${ITcpSocket}>;
// This method is not available in managed environment
// This method is not available in native environment

When connection occurs, a connected TCP socket is returned.

Listen for incoming connection. bind must be called before calling this method.