Skip to main content

FakeSocket

A class in Root.Township, Alta.Networking.

A do-nothing socket for running without a network. Sends report success and go nowhere; most other calls log an error.

Constructors​

MemberWhat it is
FakeSocket()Creates a FakeSocket with default values.

Properties​

MemberWhat it is
int ConnectionCount { get; }Always 0.
IEnumerable<Connection> Connections { get; }Always empty.
ConnectionChannel DefaultChannel { get; set; }Default channel; unused.
static FakeSocket Instance { get; }The single fake socket.
bool IsServer { get; }Always true.
int OutgoingQueueSize { get; set; }Unused.
ITransportSocket TransportSocket { get; }Always null.

Events​

MemberWhat it is
event ConnectionEventHandler ConnectionCreatedNever raised.
event ConnectionEventHandler ConnectionDestroyedNever raised.
event Action<ISocket> SocketDestroyedNever raised.

Methods​

MemberWhat it is
Connection CreateConnection(string ipAddress, int port)Logs an error and returns null.
Connection CreateConnection(ITransportConnection transportConnection, string ipAddress)Logs an error and returns null.
void DestroyConnection(Connection connection, bool isFlushing = false)Logs an error.
void Dispose()Does nothing.
Connection GetConnection(int identifier)Logs an error and returns null.
bool SendToAll(ConnectionChannel channel, MessageType type, SerializeConnectionMethod method)Does nothing and returns true.
bool SendToPlayers(ConnectionChannel channel, MessageType type, SerializeConnectionMethod method, IEnumerable<IPlayer> players)Does nothing and returns true.
void UpdateReceive()Logs an error.
void UpdateRecieve()Misspelled extra method. Logs an error.
void UpdateSend()Logs an error.