Mirror Networking
NetworkConnectionToServer.cs
1using System;
2using System.Runtime.CompilerServices;
3
4namespace Mirror
5{
7 {
8 public override string address => "";
9
10 // Send stage three: hand off to transport
11 [MethodImpl(MethodImplOptions.AggressiveInlining)]
12 protected override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable) =>
13 Transport.activeTransport.ClientSend(segment, channelId);
14
16 public override void Disconnect()
17 {
18 // set not ready and handle clientscene disconnect in any case
19 // (might be client or host mode here)
20 // TODO remove redundant state. have one source of truth for .ready!
21 isReady = false;
22 NetworkClient.ready = false;
24 }
25 }
26}
Base NetworkConnection class for server-to-client and client-to-server connection.
bool isReady
A server connection is ready after joining the game world.
override void Disconnect()
Disconnects this connection.
Abstract transport layer component
Definition: Transport.cs:32
static Transport activeTransport
The current transport used by Mirror.
Definition: Transport.cs:35
abstract void ClientSend(ArraySegment< byte > segment, int channelId=Channels.Reliable)
Sends a message to the server over the given channel.
abstract void ClientDisconnect()
Disconnects the client from the server