Files
sbox-public/engine/Sandbox.Engine/Systems/Networking/Transports/EmptyConnection.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

23 lines
723 B
C#

namespace Sandbox.Network;
/// <summary>
/// An empty connection that can be used for testing and optimizing processing.
/// Messages can not actually be sent to it, and it won't receive any either. Other clients
/// will be unaware of it.
/// </summary>
internal class EmptyConnection : Connection
{
public override string Address => "empty";
public override string Name => "empty";
public override bool IsHost => false;
internal override void InternalClose( int closeCode, string closeReason ) { }
internal override void InternalRecv( NetworkSystem.MessageHandler handler ) { }
internal override void InternalSend( ByteStream stream, NetFlags flags ) { }
public EmptyConnection( Guid id )
{
Id = id;
}
}