Network Sniffer - Software network packet sniffer & protocol analyzer for Windows
Download Device Monitoring Studio Hide this button

ITcpListener Interface

interface ITcpListener {

    // Methods
    ${listen}(): Promise<${ITcpSession}>;
    ${close}(): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment

ITcpListener Methods

listen

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

Returns a promise. When the promise becomes ready, it produces a reference to TCP Session object you may use to communicate with connected party.

Start listening on a configured endpoint. This method completes immediately, returning a promise object. When this promise becomes ready, it yields a reference to new TCP session object, which represents the connected party.

Listen for a new TCP connection

async function listen() {
    var l = await networkManager.createTcpListener("localhost", 80);
    var socket = await l.listen();
}

close

close(): void;
// This method is not available in managed environment
// This method is not available in native environment

Closes the listener object. This object may not be used after the close operation.