From e07d61831bc00703d544c92cfda343da563322ee Mon Sep 17 00:00:00 2001 From: Christian <6939810+chkr1011@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:14:05 +0100 Subject: [PATCH] Delete CoapServer.cs --- Source/CoAPnet/Server/CoapServer.cs | 136 ---------------------------- 1 file changed, 136 deletions(-) delete mode 100644 Source/CoAPnet/Server/CoapServer.cs diff --git a/Source/CoAPnet/Server/CoapServer.cs b/Source/CoAPnet/Server/CoapServer.cs deleted file mode 100644 index 70c2c74..0000000 --- a/Source/CoAPnet/Server/CoapServer.cs +++ /dev/null @@ -1,136 +0,0 @@ -//using System; -//using System.Collections.Generic; -//using System.Net; -//using System.Net.Sockets; -//using System.Threading; -//using System.Threading.Tasks; -//using CoAPnet.Protocol; - -//namespace CoAPnet.Server -//{ -// public interface ICoapServer : IDisposable -// { -// Task StartAsync(); - -// Task StopAsync(); -// } - -// public sealed class CoapServer : ICoapServer -// { -// public ICoapRequestHandler RequestHandler { get; set; } - -// public List Endpoints { get; } = new List(); - -// CancellationTokenSource _cancellationTokenSource; - -// public Task StartAsync() -// { -// return Task.FromResult(0); -// } - -// public Task StopAsync() -// { -// return Task.FromResult(0); -// } - -// public void Dispose() -// { -// _cancellationTokenSource?.Cancel(); -// _cancellationTokenSource?.Dispose(); -// } -// } - -// public interface ICoapRequestHandler -// { -// Task HandleCoapRequest(CoapRequestContext context, CancellationToken cancellationToken); -// } - -// public class CoapRequestContext -// { -// public Dictionary Properties { get; } = new Dictionary(); - -// public ICoapServerClient Client { get; set; } - -// public CoapMessage Request { get; set; } - -// public CoapMessage Response { get; set; } - -// public bool CloseConnection { get; set; } -// } - -// public interface ICoapServerEndpoint : IDisposable -// { -// Task BindAsync(CancellationToken cancellationToken); - -// Task AcceptAsync(CancellationToken cancellationToken); -// } - -// public interface ICoapServerClient : IDisposable -// { -// Task ReceiveAsync(CancellationToken cancellationToken); - -// Task SendAsync(CancellationToken cancellationToken); -// } - -// public sealed class CoapServerUdpEndpoint : ICoapServerEndpoint -// { -// readonly byte[] _buffer = new byte[650000]; - -// readonly Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - -// public int Port { get; set; } = 5643; - -// public IPAddress IpAddress { get; set; } = IPAddress.Any; - -// public Task BindAsync(CancellationToken cancellationToken) -// { -// _socket.Bind(new IPEndPoint(IpAddress, Port)); -// return Task.FromResult(0); -// } - -// public Task AcceptAsync(CancellationToken cancellationToken) -// { -// cancellationToken.ThrowIfCancellationRequested(); - -// EndPoint ipEndPoint = new IPEndPoint(IpAddress, 0); -// var datagramSize = _socket.ReceiveFrom(_buffer, SocketFlags.None, ref ipEndPoint); - -// cancellationToken.ThrowIfCancellationRequested(); - -// var datagram = new byte[datagramSize]; -// Array.Copy(_buffer, 0, datagram, 0, datagramSize); - -// var client = new CoapServerUdpEndpointClient(); - -// return Task.FromResult((ICoapServerClient)client); -// } - -// public void Dispose() -// { -// _socket?.Dispose(); -// } -// } - -// public sealed class CoapServerUdpEndpointClient : ICoapServerClient -// { -// public CoapServerUdpEndpointClient() -// { - -// } - -// public Task ReceiveAsync(CancellationToken cancellationToken) -// { -// throw new NotImplementedException(); -// } - -// public Task SendAsync(CancellationToken cancellationToken) -// { -// throw new NotImplementedException(); -// } - -// public void Dispose() -// { -// throw new NotImplementedException(); -// } -// } -//}