115 public abstract void ServerSend(
int connectionId, ArraySegment<byte> segment,
int channelId =
Channels.Reliable);
157#pragma warning disable UNT0001
158 public void Update() {}
159 public void LateUpdate() {}
160#pragma warning restore UNT0001
175 public virtual void ServerEarlyUpdate() {}
176 public virtual void ClientLateUpdate() {}
177 public virtual void ServerLateUpdate() {}
Abstract transport layer component
Action OnClientConnected
Called by Transport when the client connected to the server.
abstract void ServerStart()
Start listening for connections.
virtual void ClientEarlyUpdate()
NetworkLoop NetworkEarly/LateUpdate were added for a proper network update order. the goal is to: pro...
abstract bool ClientConnected()
True if the client is currently connected to the server.
Action OnClientDisconnected
Called by Transport when the client disconnected from the server.
Action< int > OnServerConnected
Called by Transport when a new client connected to the server.
abstract Uri ServerUri()
Returns server address as Uri.
static Transport activeTransport
The current transport used by Mirror.
abstract void ServerSend(int connectionId, ArraySegment< byte > segment, int channelId=Channels.Reliable)
Send a message to a client over the given channel.
virtual void OnApplicationQuit()
Called by Unity when quitting. Inheriting Transports should call base for proper Shutdown.
Action< ArraySegment< byte >, int > OnClientDataReceived
Called by Transport when the client received a message from the server.
abstract void ServerStop()
Stop listening and disconnect all connections.
Action< ArraySegment< byte >, int > OnClientDataSent
Called by Transport when the client sent a message to the server.
abstract string ServerGetClientAddress(int connectionId)
Get a client's address on the server.
abstract void ClientSend(ArraySegment< byte > segment, int channelId=Channels.Reliable)
Sends a message to the server over the given channel.
abstract void Shutdown()
Shut down the transport, both as client and server
abstract bool Available()
Is this transport available in the current platform?
Action< int, TransportError, string > OnServerError
Called by Transport when a server's connection encountered a problem.
Action< int, ArraySegment< byte >, int > OnServerDataSent
Called by Transport when the server sent a message to a client.
Action< int > OnServerDisconnected
Called by Transport when a client disconnected from the server.
abstract void ClientConnect(string address)
Connects the client to the server at the address.
Action< int, ArraySegment< byte >, int > OnServerDataReceived
Called by Transport when the server received a message from a client.
virtual void ClientConnect(Uri uri)
Connects the client to the server at the Uri.
abstract void ServerDisconnect(int connectionId)
Disconnect a client from the server.
abstract void ClientDisconnect()
Disconnects the client from the server
virtual int GetBatchThreshold(int channelId=Channels.Reliable)
Recommended Batching threshold for this transport.
abstract bool ServerActive()
True if the server is currently listening for connections.
Action< TransportError, string > OnClientError
Called by Transport when the client encountered an error.
abstract int GetMaxPacketSize(int channelId=Channels.Reliable)
Maximum message size for the given channel.