NamedPipeTransport class

Named pipes based transport sender and receiver abstraction

Constructors

NamedPipeTransport(INodeSocket)

Creates a new instance of the NamedPipeTransport class.

Properties

isConnected

Returns true if currently connected.

PipePath
ServerIncomingPath
ServerOutgoingPath

Methods

close()

Closes the transport.

receive(number)

Receive from the transport into the buffer.

send(INodeBuffer)

Writes to the pipe and sends.

Constructor Details

NamedPipeTransport(INodeSocket)

Creates a new instance of the NamedPipeTransport class.

new NamedPipeTransport(socket: INodeSocket)

Parameters

socket
INodeSocket

The socket object to build this connection on.

Property Details

isConnected

Returns true if currently connected.

boolean isConnected

Property Value

boolean

true if the the transport is connected and ready to send data, false otherwise.

PipePath

static PipePath: string

Property Value

string

ServerIncomingPath

static ServerIncomingPath: string

Property Value

string

ServerOutgoingPath

static ServerOutgoingPath: string

Property Value

string

Method Details

close()

Closes the transport.

function close()

receive(number)

Receive from the transport into the buffer.

function receive(count: number): Promise<INodeBuffer>

Parameters

count

number

The maximum amount of bytes to write to the buffer.

Returns

Promise<INodeBuffer>

The buffer containing the data from the transport.

send(INodeBuffer)

Writes to the pipe and sends.

function send(buffer: INodeBuffer): number

Parameters

buffer
INodeBuffer

The buffer full of data to send out across the socket.

Returns

number

A number indicating the length of the sent data if the data was successfully sent, otherwise 0.