confused screaming

This commit is contained in:
2026-02-05 15:34:59 +01:00
parent a9536ac780
commit c4223d45e4
16 changed files with 323 additions and 237 deletions

View File

@@ -0,0 +1,29 @@
using PVHelpers;
using System.Net;
using System.Net.Sockets;
namespace RemoteFrameBuffer.Client
{
public class RemoteFrameBufferTcpClientStreamProvider : IRemoteFrameBufferClientStreamProvider
{
private readonly INetEndPoint remoteEndPoint;
private readonly IPEndPoint localEndPoint;
public RemoteFrameBufferTcpClientStreamProvider(INetEndPoint remoteEndPoint, IPEndPoint? localEndPoint)
{
this.remoteEndPoint = remoteEndPoint;
this.localEndPoint = localEndPoint ?? new(IPAddress.Any, 0);
}
public Stream GetRemoteFrameBufferClientStream()
{
TcpClient tcpClient = new TcpClient(this.localEndPoint);
tcpClient.Connect(this.remoteEndPoint.EndPoint);
return tcpClient.GetStream();
}
public RemoteFrameBufferTcpClientStreamProvider(String hostname, Int16 port, IPEndPoint? localEndPoint = null) : this(new NetEndPointFromHostname(hostname, port), localEndPoint) { }
public RemoteFrameBufferTcpClientStreamProvider(IPAddress address, Int32 port, IPEndPoint? localEndPoint = null) : this(new NetEndPointFromIP(address, port), localEndPoint) { }
public RemoteFrameBufferTcpClientStreamProvider(IPEndPoint remoteEndPoint, IPEndPoint? localEndPoint = null) : this(new NetEndPointFromIP(remoteEndPoint), localEndPoint) { }
}
}