mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-06 15:56:29 +02:00
Reorganize project structure
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace RemSox.Shared.Networking;
|
||||
|
||||
/// <summary>
|
||||
/// Simple wrapper around TcpClient to hold connection-scoped resources safely.
|
||||
/// </summary>
|
||||
public class TcpConnection(TcpClient client) : IDisposable
|
||||
{
|
||||
public TcpClient Client { get; } = client;
|
||||
public NetworkStream Stream { get; } = client.GetStream();
|
||||
public object SendLock { get; } = new();
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Stream.Dispose();
|
||||
Client.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user