#if !BESTHTTP_DISABLE_SOCKETIO
using System.Collections.Generic;
namespace BestHTTP.SocketIO3.Transports
{
public enum TransportTypes
{
Polling,
#if !BESTHTTP_DISABLE_WEBSOCKET
WebSocket
#endif
}
///
/// Possible states of an ITransport implementation.
///
public enum TransportStates : int
{
///
/// The transport is connecting to the server.
///
Connecting = 0,
///
/// The transport is connected, and started the opening process.
///
Opening = 1,
///
/// The transport is open, can send and receive packets.
///
Open = 2,
///
/// The transport is closed.
///
Closed = 3,
///
/// The transport is paused.
///
Paused = 4
}
///
/// An interface that a Socket.IO transport must implement.
///
public interface ITransport
{
///
/// Type of this transport.
///
TransportTypes Type { get; }
///
/// Current state of the transport
///
TransportStates State { get; }
///
/// SocketManager instance that this transport is bound to.
///
SocketManager Manager { get; }
///
/// True if the transport is busy with sending messages.
///
bool IsRequestInProgress { get; }
///
/// True if the transport is busy with a poll request.
///
bool IsPollingInProgress { get; }
///
/// Start open/upgrade the transport.
///
void Open();
///
/// Do a poll for available messages on the server.
///
void Poll();
///
/// Send a single packet to the server.
///
void Send(OutgoingPacket packet);
///
/// Send a list of packets to the server.
///
void Send(List packets);
///
/// Close this transport.
///
void Close();
}
}
#endif