mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
17 lines
444 B
C#
17 lines
444 B
C#
using System.Net.Sockets;
|
|
|
|
/// <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();
|
|
}
|
|
} |