UNPKG

botframework-streaming

Version:

Streaming library for the Microsoft Bot Framework

58 lines 1.95 kB
/** * @module botframework-streaming */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { INodeBuffer, INodeSocket, ITransportSender, ITransportReceiver } from '../interfaces'; /** * Named pipes based transport sender and receiver abstraction */ export declare class NamedPipeTransport implements ITransportSender, ITransportReceiver { private socket; static readonly PipePath: string; static readonly ServerIncomingPath: string; static readonly ServerOutgoingPath: string; private readonly _queue; private _active; private _activeOffset; private _activeReceiveCount; private _activeReceiveResolve; private _activeReceiveReject; /** * Creates a new instance of the [NamedPipeTransport](xref:botframework-streaming.NamedPipeTransport) class. * * @param socket The socket object to build this connection on. */ constructor(socket: INodeSocket); /** * Writes to the pipe and sends. * * @param buffer The buffer full of data to send out across the socket. * @returns A number indicating the length of the sent data if the data was successfully sent, otherwise 0. */ send(buffer: INodeBuffer): number; /** * Returns `true` if currently connected. * * @returns `true` if the the transport is connected and ready to send data, `false` otherwise. */ get isConnected(): boolean; /** * Closes the transport. */ close(): void; /** * Receive from the transport into the buffer. * * @param count The maximum amount of bytes to write to the buffer. * @returns The buffer containing the data from the transport. */ receive(count: number): Promise<INodeBuffer>; private socketReceive; private socketClose; private socketError; private trySignalData; } //# sourceMappingURL=namedPipeTransport.d.ts.map