-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSockets.cs
More file actions
23 lines (20 loc) · 726 Bytes
/
Sockets.cs
File metadata and controls
23 lines (20 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace Samicpp.Http;
using System.Net.Security;
using System.Net.Sockets;
// maybe quic socket in here in the future
public class TcpSocket(NetworkStream stream) : ADualSocket
{
public TcpSocket(Socket socket): this(new NetworkStream(socket, true)) {}
override protected NetworkStream Stream { get; } = stream;
override public bool IsSecure { get; } = false;
}
public class TlsSocket(SslStream stream) : ADualSocket
{
override protected SslStream Stream { get; } = stream;
override public bool IsSecure { get; } = true;
}
public class UnknownSocket(Stream stream) : ADualSocket
{
override protected Stream Stream { get; } = stream;
override public bool IsSecure { get; } = false; // unknown
}