Class LinoConnection
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
streamStreamprotocolILinoProtocol
Properties
Protocol
The protocol in use.
public ILinoProtocol Protocol { get; }
Property Value
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>>
Request(IReadOnlyList<Link<string>>)
Sends document and waits for the reply.
public IReadOnlyList<Link<string>> Request(IReadOnlyList<Link<string>> document)
Parameters
documentIReadOnlyList<Link<string>>
Returns
- IReadOnlyList<Link<string>>
Send(IReadOnlyList<Link<string>>)
Sends one document.
public void Send(IReadOnlyList<Link<string>> document)
Parameters
documentIReadOnlyList<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
timeoutTimeSpan
Returns
Remarks
A stream that cannot time out waits until something arrives. InfiniteTimeSpan waits forever.