Skip to main content

Class: TCPSocket

Extends

  • AsyncDisposable

Constructors

Constructor

new TCPSocket(remoteAddress, remotePort, options?): TCPSocket

Parameters

remoteAddress

string

remotePort

number

options?

TCPSocketOptions

Returns

TCPSocket

Properties

closed

readonly closed: Promise<void>


opened

readonly opened: Promise<TCPSocketOpenInfo>

Methods

close()

close(): void

Initiates close. Use closed to await full teardown.

The class is also async-disposable: at the end of an await using s = new TCPSocket(...) scope the socket is closed and closed is awaited.

Returns

void