Table of Contents

Class LinoConnection

Namespace
Foundation.Data.Doublets.Cli.Protocol
Assembly
Foundation.Data.Doublets.Cli.dll

A byte stream decorated with an ILinoProtocol.

public sealed class LinoConnection : IDisposable
Inheritance
LinoConnection
Implements
Inherited Members

Constructors

LinoConnection(Stream, ILinoProtocol)

Wraps stream; disposing the connection disposes the stream.

public LinoConnection(Stream stream, ILinoProtocol protocol)

Parameters

stream Stream
protocol ILinoProtocol

Properties

Protocol

The protocol in use.

public ILinoProtocol Protocol { get; }

Property Value

ILinoProtocol

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Receive()

Receives one document; null when the peer closed the stream.

public IReadOnlyList<Link<string>>? Receive()

Returns

IReadOnlyList<Link<string>>

Sends document and waits for the reply.

public IReadOnlyList<Link<string>> Request(IReadOnlyList<Link<string>> document)

Parameters

document IReadOnlyList<Link<string>>

Returns

IReadOnlyList<Link<string>>

Sends one document.

public void Send(IReadOnlyList<Link<string>> document)

Parameters

document IReadOnlyList<Link<string>>

WaitForMessage(TimeSpan)

Waits up to timeout for the peer to send something; true when a message (or the end of the stream) is ready for Receive(), false when the time ran out with nothing to read.

public bool WaitForMessage(TimeSpan timeout)

Parameters

timeout TimeSpan

Returns

bool

Remarks

A stream that cannot time out waits until something arrives. InfiniteTimeSpan waits forever.