HalfSocket

HalfSocket

One end of a socket, either client or server. Serves as a pass-through to the other side.

Constructor

new HalfSocket(name, opts)

Creates an instance of HalfSocket.
Source:
Parameters:
Name Type Description
name string The name of this socket end, for debugging.
opts stream.DuplexOptions Options for the socket end.
Fires:
  • {HalfSocket#written} When data is written to this side of the socket to be sent.event:

Classes

HalfSocket

Methods

emit(eventName, …args) → {boolean}

Add debug logging to EventEmitter. Start with NODE_DEBUG=mock-tls-server to see all events.
Source:
Parameters:
Name Type Attributes Description
eventName string The name of the event.
args Array.<any> <repeatable>
The arguments to be passed to listeners.
Returns:
Type:
boolean
Returns `true` if the event had listeners, `false` otherwise.

Events

written

Data was written to a HalfSocket.
Source:
Parameters:
Name Type Description
data Buffer | string The data that was written.
encoding string The encoding for the data.