S101Client Class |
Namespace: Lawo.EmberPlusSharp.S101
public sealed class S101Client : IMonitoredConnection, IDisposable
The S101Client type exposes the following members.
Name | Description | |
---|---|---|
S101Client(IDisposable, ReadAsyncCallback, WriteAsyncCallback) | Initializes a new instance of the S101Client class by calling
S101Client(connection,
readAsync, writeAsync, null). | |
S101Client(IDisposable, ReadAsyncCallback, WriteAsyncCallback, IS101Logger) | Initializes a new instance of the S101Client class by calling
S101Client(connection,
readAsync, writeAsync, logger, 3000, 8192).
| |
S101Client(IDisposable, ReadAsyncCallback, WriteAsyncCallback, IS101Logger, Int32, Int32) | Initializes a new instance of the S101Client class. |
Name | Description | |
---|---|---|
KeepAliveRequestSlot | Gets or sets the value to set the Slot property to for a message
containing a KeepAliveRequest command. |
Name | Description | |
---|---|---|
Dispose | See Dispose. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
SendMessageAsync(S101Message) | ||
SendMessageAsync(S101Message, Byte) | Sends message followed by payload. | |
SendOutOfFrameByteAsync | Sends value as an out-of-frame byte. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
ConnectionLost | Occurs when the connection to the provider has been lost. | |
EmberDataReceived | Occurs when the client has received the full payload of a message with an EmberData
command. | |
OutOfFrameByteReceived | Occurs when an out-of-frame byte has been received. |
See the "Ember+ Specification"[1] , chapter "Message Framing".
Automatically answers any message containing a KeepAliveRequest command with a message containing a KeepAliveResponse command.
Automatically sends messages containing a KeepAliveRequest command according to the value passed to S101Client(IDisposable, ReadAsyncCallback, WriteAsyncCallback, IS101Logger, Int32, Int32) for the timeout parameter. If no bytes are received from the remote party for half the timeout period then a message containing a KeepAliveRequest is sent. If no message of any kind is received during the second half of the timeout period, the ConnectionLost event is raised with an S101Exception.
This class requires that Current returns a context that executes all continuations on a single thread. For an S101Client object constructed on the GUI thread of a Windows Forms, WPF or Windows Store App this already the case. Other environments, e.g. Console Applications, ASP.net applications or unit test environments either do not have a synchronization context (Current equals null) or do not guarantee execution on a single thread. For such environments it is the responsibility of the client to set Current appropriately before constructing a S101Client object. Run(FuncTask) provides an easy way to do that.