NamedPipeServer class
Streaming transport server implementation that uses named pipes for inter-process communication.
Constructors
Named |
Creates a new instance of the NamedPipeServer class. |
Properties
is |
Get connected status |
Methods
disconnect() | Allows for manually disconnecting the server. |
send(Streaming |
Task used to send data over this client connection. |
start(() => void) | Used to establish the connection used by this server and begin listening for incoming messages. |
Constructor Details
NamedPipeServer(string, RequestHandler, boolean)
Creates a new instance of the NamedPipeServer class.
new NamedPipeServer(baseName: string, requestHandler?: RequestHandler, autoReconnect?: boolean)
Parameters
- baseName
-
string
The named pipe to connect to.
- requestHandler
- RequestHandler
Optional RequestHandler to process incoming messages received by this client.
- autoReconnect
-
boolean
Deprecated: Automatic reconnection is the default behavior.
Property Details
isConnected
Get connected status
boolean isConnected
Property Value
boolean
true if currently connected.
Method Details
disconnect()
Allows for manually disconnecting the server.
function disconnect()
send(StreamingRequest)
Task used to send data over this client connection.
function send(request: StreamingRequest): Promise<IReceiveResponse>
Parameters
- request
- StreamingRequest
The StreamingRequest to send.
Returns
Promise<IReceiveResponse>
A promise for an instance of IReceiveResponse on completion of the send operation.
start(() => void)
Used to establish the connection used by this server and begin listening for incoming messages.
function start(onListen?: () => void): Promise<string>
Parameters
- onListen
-
() => void
Optional callback that fires once when server is listening on both incoming and outgoing pipe
Returns
Promise<string>
A promised string that will not resolve as long as the server is running.