Class ZOBinaryMessagePublisher
Publisher of binary message over TCP.
Stream format: string: Topic + "\n" int32: size of data byte: data
Inheritance
System.Object
ZOBinaryMessagePublisher
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZO.Networking
Assembly: Unity.ZeroSim.dll
Syntax
public class ZOBinaryMessagePublisher
Properties
| Improve this Doc View SourceDebug
Declaration
public bool Debug { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IPAddress
Declaration
public IPAddress IPAddress { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IPAddress |
Port
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SubscriberCount
Declaration
public int SubscriberCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Topic
Declaration
public string Topic { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceFinalize()
Declaration
protected void Finalize()
OnSubscriberConnected(ZOTCPServer, TcpClient)
Dummy OnSubscriberConnected delegate for ZOTCPServer
Declaration
protected virtual Task OnSubscriberConnected(ZOTCPServer tcpServer, TcpClient tcpClient)
Parameters
Type | Name | Description |
---|---|---|
ZOTCPServer | tcpServer | |
System.Net.Sockets.TcpClient | tcpClient |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnSubscriberDisconnected(ZOTCPServer, TcpClient)
/// Dummy OnSubscriberDisconnected delegate for ZOTCPServer
Declaration
protected virtual Task OnSubscriberDisconnected(ZOTCPServer tcpServer, TcpClient tcpClient)
Parameters
Type | Name | Description |
---|---|---|
ZOTCPServer | tcpServer | |
System.Net.Sockets.TcpClient | tcpClient |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Publish(ArraySegment<Byte>)
Async publish binary message using ArraySegment to hold the data.
Declaration
public virtual Task Publish(ArraySegment<byte> data)
Parameters
Type | Name | Description |
---|---|---|
System.ArraySegment<System.Byte> | data | the data |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task |
Publish(MemoryStream)
Async publish binary message using MemoryStream to hold the data.
Declaration
public virtual Task Publish(MemoryStream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.MemoryStream | stream | The data |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task |
RunAsync()
Starts the message publisher as an Async task
Declaration
public Task RunAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task |
SendHeader(UInt32)
Sends header with format: string: Topic + "\n" int32: size of data
Declaration
protected virtual Task SendHeader(uint msgSize)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | msgSize |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Stop()
Stops publisher.
Declaration
public void Stop()