using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.Transport
{
///
/// Represents a transport adapter capable of connecting, writing and receiving data from a stream.
///
///
public interface ITransportAdapter : ITransportComponent, INotifyPropertyChanged
{
///
/// Gets the last failed state exception/reason.
///
Exception FailedStateException { get; }
///
/// Gets the total bytes received.
///
long TotalBytesReceived { get; }
///
/// Gets the total bytes sent.
///
long TotalBytesSent { get; }
///
/// Gets the adapter current transfer rate.
///
long TransferRate { get; }
///
/// Gets or sets a value indicating whether to enable compression/decompression of data.
///
bool EnableCompression { get; set; }
///
/// Writes the specified data to the stream.
///
/// The data.
/// Writes the data as soon as possible while ignoring any message queuing and batching.
void Write(byte[] data, bool immidiate = false);
///
/// Occurs when new data is available.
///
event EventHandler DataAvailable;
///
/// Gets or sets the adapter address.
///
String Address { get; set; }
}
}