Skip to content

StreamSocketEvents

StreamSocketEvents = object

Defined in: packages/node/src/net/stream-socket.ts:16

Event map for StreamSocket lifecycle events.

These correspond to the core net.Socket events that are meaningful for any stream-oriented connection, regardless of the underlying transport (TCP, Unix domain socket, etc.).

close: [boolean]

Defined in: packages/node/src/net/stream-socket.ts:30

Emitted once the socket has been fully closed.

After this event the socket is no longer usable.


connect: []

Defined in: packages/node/src/net/stream-socket.ts:37

Emitted when the socket connection is successfully established.

This maps to the underlying net.Socket “connect” event.


error: [IError]

Defined in: packages/node/src/net/stream-socket.ts:23

Emitted when an error occurs on the underlying socket.

After this event the implementation will typically attempt to close the socket and then emit StreamSocketEvents.close.


ready: []

Defined in: packages/node/src/net/stream-socket.ts:45

Emitted when the socket is ready for I/O.

On Node.js this is typically fired immediately after “connect”, once the internal initialization is complete.


timeout: []

Defined in: packages/node/src/net/stream-socket.ts:53

Emitted if the socket times out from inactivity.

The underlying connection is not automatically closed; it is up to the caller to decide whether to end or destroy the socket.