This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace ShrinkNetwork
|
||||
{
|
||||
public interface IShrinkNetworkAsyncTransport : IShrinkNetworkTransport
|
||||
{
|
||||
UniTask SendAsync(long sessionId, byte[] packetData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9741e558eb992d4eae93726109250eb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
#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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 427412ffd76529b418e1446e059516b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user