public EchoServer(EndPoint endPoint, ITestOutputHelper output) { _output = output; _socket = new Socket(endPoint.AddressFamily(), endPoint.SocketType(), endPoint.ProtocolType()); _socket.Bind(endPoint); _socket.Listen(); _endPoint = _socket.LocalEndPoint; _cts = new CancellationTokenSource(); Task.Run(async() => await Accept()); }
public EchoClient(EndPoint endPoint) { _socket = new Socket(endPoint.AddressFamily(), endPoint.SocketType(), endPoint.ProtocolType()); _socket.Connect(endPoint); }