using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace uPLibrary.Networking.M2Mqtt { /// /// Interface for channel under MQTT library /// public interface IMqttNetworkChannel { /// /// Data available on channel /// bool DataAvailable { get; } /// /// Receive data from the network channel /// /// Data buffer for receiving data /// Number of bytes received int Receive(byte[] buffer); /// /// Receive data from the network channel with a specified timeout /// /// Data buffer for receiving data /// Timeout on receiving (in milliseconds) /// Number of bytes received int Receive(byte[] buffer, int timeout); /// /// Send data on the network channel to the broker /// /// Data buffer to send /// Number of byte sent int Send(byte[] buffer); /// /// Close the network channel /// void Close(); /// /// Connect to remote server /// void Connect(); /// /// Accept client connection /// void Accept(); } }