Files
ShrinkNetwork/Runtime/Transport/Abstractions/IShrinkNetworkTransport.cs
T
cneicy 8eaaa3040a
Publish UPM package / publish (push) Failing after 1s
chore: initialize standalone UPM package
2026-08-26 02:50:34 +08:00

48 lines
1.5 KiB
C#

#nullable enable
using System;
using System.Security.Authentication;
namespace ShrinkNetwork
{
public interface IShrinkNetworkTransport
{
bool IsStarted { get; }
event Action<ShrinkNetworkTransportEvent> OnEvent;
void Start();
void Stop();
void Send(long sessionId, byte[] packetData);
}
public interface IShrinkNetworkSessionControlTransport
{
bool DisconnectSession(long sessionId, string? reason = null);
}
public sealed class ShrinkTcpTlsOptions
{
public bool Enabled { get; set; }
public string? TargetHost { get; set; }
public bool AllowInvalidServerCertificate { get; set; }
public string? ServerCertificatePath { get; set; }
public string? ServerCertificatePassword { get; set; }
public bool CheckCertificateRevocation { get; set; } = true;
public SslProtocols EnabledProtocols { get; set; } = SslProtocols.None;
public ShrinkTcpTlsOptions Clone()
{
return new ShrinkTcpTlsOptions
{
Enabled = Enabled,
TargetHost = TargetHost,
AllowInvalidServerCertificate = AllowInvalidServerCertificate,
ServerCertificatePath = ServerCertificatePath,
ServerCertificatePassword = ServerCertificatePassword,
CheckCertificateRevocation = CheckCertificateRevocation,
EnabledProtocols = EnabledProtocols
};
}
}
}