Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add quic #721

Closed
wants to merge 18 commits into from
30 changes: 30 additions & 0 deletions SuperSocket.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Connection", "s
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Kestrel", "src\SuperSocket.Kestrel\SuperSocket.Kestrel.csproj", "{8C8507D6-903F-4786-8F18-ACA54257454B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Quic.Connection", "src\SuperSocket.Quic.Connection\SuperSocket.Quic.Connection.csproj", "{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Quic", "src\SuperSocket.Quic\SuperSocket.Quic.csproj", "{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -241,6 +245,30 @@ Global
{8C8507D6-903F-4786-8F18-ACA54257454B}.Release|x64.Build.0 = Release|Any CPU
{8C8507D6-903F-4786-8F18-ACA54257454B}.Release|x86.ActiveCfg = Release|Any CPU
{8C8507D6-903F-4786-8F18-ACA54257454B}.Release|x86.Build.0 = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|x64.ActiveCfg = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|x64.Build.0 = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|x86.ActiveCfg = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Debug|x86.Build.0 = Debug|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|Any CPU.Build.0 = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|x64.ActiveCfg = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|x64.Build.0 = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|x86.ActiveCfg = Release|Any CPU
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97}.Release|x86.Build.0 = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|x64.ActiveCfg = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|x64.Build.0 = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|x86.ActiveCfg = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Debug|x86.Build.0 = Debug|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|Any CPU.Build.0 = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|x64.ActiveCfg = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|x64.Build.0 = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|x86.ActiveCfg = Release|Any CPU
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -262,6 +290,8 @@ Global
{8454E8D5-777D-46CB-B050-76C5119B624B} = {DDA4741E-097F-40C3-A252-2E1E3476C1A7}
{FC2B529F-4AF4-4C39-BC4F-A3836CC7B37C} = {DDA4741E-097F-40C3-A252-2E1E3476C1A7}
{8C8507D6-903F-4786-8F18-ACA54257454B} = {DDA4741E-097F-40C3-A252-2E1E3476C1A7}
{8F14B3E1-C9D8-4E9E-ACDA-D424BA44CA97} = {DDA4741E-097F-40C3-A252-2E1E3476C1A7}
{AEE8630B-3A2E-48BB-A55C-35C9D2D205DF} = {DDA4741E-097F-40C3-A252-2E1E3476C1A7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ADB30AA2-A848-4CB3-8A20-488C80F1BA9E}
Expand Down
52 changes: 52 additions & 0 deletions src/SuperSocket.Quic.Connection/QuicPipeConnection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Net;
using System.Net.Quic;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using SuperSocket.Connection;

#pragma warning disable CA2252

namespace SuperSocket.Quic.Connection
{
public class QuicPipeConnection : StreamPipeConnection
{
private readonly QuicPipeStream _stream;

public QuicPipeConnection(QuicPipeStream stream, EndPoint remoteEndPoint, ConnectionOptions options)
: this(stream, remoteEndPoint, null, options)
{
_stream = stream;
}

public QuicPipeConnection(QuicPipeStream stream, EndPoint remoteEndPoint, EndPoint localEndPoint,
ConnectionOptions options)
: base(stream, remoteEndPoint, localEndPoint, options)
{
_stream = stream;
}

protected override async Task StartInputPipeTask<TPackageInfo>(IObjectPipe<TPackageInfo> packagePipe,
CancellationToken cancellationToken)
{
await _stream.OpenStreamAsync(cancellationToken);
await base.StartInputPipeTask(packagePipe, cancellationToken);
}

protected override bool IsIgnorableException(Exception e)
{
if (base.IsIgnorableException(e))
return true;

switch (e)
{
case QuicException:
case SocketException se when se.IsIgnorableSocketException():
return true;
default:
return false;
}
}
}
}
75 changes: 75 additions & 0 deletions src/SuperSocket.Quic.Connection/QuicPipeStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System;
using System.IO;
using System.Net.Quic;
using System.Threading;
using System.Threading.Tasks;

namespace SuperSocket.Quic.Connection;

#pragma warning disable CA2252

public sealed class QuicPipeStream : Stream
{
private Stream _stream;

private readonly bool _serverStream;
private readonly QuicConnection _connection;

public QuicPipeStream(QuicConnection connection, bool serverStream)
{
_connection = connection;
_serverStream = serverStream;
}

public override bool CanRead => _stream.CanRead;
public override bool CanSeek => _stream.CanSeek;
public override bool CanWrite => _stream.CanWrite;
public override long Length => _stream.Length;

public override long Position
{
get => _stream.Position;
set => _stream.Position = value;
}

public async ValueTask OpenStreamAsync(CancellationToken cancellationToken)
{
if (_serverStream)
{
_stream = await _connection.AcceptInboundStreamAsync(cancellationToken);

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 39 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.AcceptInboundStreamAsync(CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}
else
{
_stream = await _connection.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancellationToken);

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicStreamType.Bidirectional' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic.Connection/QuicPipeStream.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.OpenOutboundStreamAsync(QuicStreamType, CancellationToken)' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}
}

public override void Flush() => _stream.Flush();

public override int Read(byte[] buffer, int offset, int count) => _stream.Read(buffer, offset, count);

public override long Seek(long offset, SeekOrigin origin) => _stream.Seek(offset, origin);

public override void SetLength(long value) => _stream.Flush();

public override void Close() => _stream.Close();

public override Task FlushAsync(CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken);

public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
_stream.ReadAsync(buffer, offset, count, cancellationToken);

public override ValueTask<int> ReadAsync(Memory<byte> buffer,
CancellationToken cancellationToken = default) => _stream.ReadAsync(buffer, cancellationToken);

public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
_stream.WriteAsync(buffer, offset, count, cancellationToken);

public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer,
CancellationToken cancellationToken = default) =>
_stream.WriteAsync(buffer, cancellationToken);

public override void Write(ReadOnlySpan<byte> buffer) => _stream.Flush();

public override void Write(byte[] buffer, int offset, int count) => _stream.Flush();
}
12 changes: 12 additions & 0 deletions src/SuperSocket.Quic.Connection/SuperSocket.Quic.Connection.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>SuperSocket quic connection library.</Description>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SuperSocket.Connection\SuperSocket.Connection.csproj" />
</ItemGroup>

</Project>
46 changes: 46 additions & 0 deletions src/SuperSocket.Quic/QuicConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Collections.Generic;
using System.IO;
using System.Net.Quic;
using System.Threading;
using System.Threading.Tasks;
using SuperSocket.Connection;
using SuperSocket.Quic.Connection;
using SuperSocket.Server.Abstractions;
using SuperSocket.Server.Abstractions.Connections;

#pragma warning disable CA2252
namespace SuperSocket.Quic
{
internal class QuicConnectionFactory : IConnectionFactory
{
private readonly ListenOptions _listenOptions;
private readonly ConnectionOptions _connectionOptions;
private readonly IEnumerable<IConnectionStreamInitializer> _connectionStreamInitializers;

public QuicConnectionFactory(
IConnectionStreamInitializersFactory connectionStreamInitializersFactory,
ListenOptions listenOptions,
ConnectionOptions connectionOptions)
{
_listenOptions = listenOptions;
_connectionOptions = connectionOptions;
_connectionStreamInitializers = connectionStreamInitializersFactory.Create(_listenOptions);
}

public async Task<IConnection> CreateConnection(object connection, CancellationToken cancellationToken)
{
Stream stream = null;
var quicConnection = connection as QuicConnection;

foreach (var initializer in _connectionStreamInitializers)
{
stream = await initializer.InitializeAsync(quicConnection, cancellationToken);
}

var quicStream = (QuicPipeStream)stream;

return new QuicPipeConnection(quicStream, quicConnection.RemoteEndPoint,

Check warning on line 42 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.RemoteEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 42 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.RemoteEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 42 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.RemoteEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 42 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.RemoteEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 42 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.RemoteEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
quicConnection.LocalEndPoint, _connectionOptions);

Check warning on line 43 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

This call site is reachable on all platforms. 'QuicConnection.LocalEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.LocalEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

This call site is reachable on all platforms. 'QuicConnection.LocalEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.LocalEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 43 in src/SuperSocket.Quic/QuicConnectionFactory.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicConnection.LocalEndPoint' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}
}
}
21 changes: 21 additions & 0 deletions src/SuperSocket.Quic/QuicConnectionFactoryBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using SuperSocket.Connection;
using SuperSocket.Server.Abstractions;
using SuperSocket.Server.Abstractions.Connections;

namespace SuperSocket.Quic
{
internal class QuicConnectionFactoryBuilder : IConnectionFactoryBuilder
{
private readonly IConnectionStreamInitializersFactory _connectionStreamInitializersFactory;

public QuicConnectionFactoryBuilder(IConnectionStreamInitializersFactory connectionStreamInitializersFactory)
{
_connectionStreamInitializersFactory = connectionStreamInitializersFactory;
}

public IConnectionFactory Build(ListenOptions listenOptions, ConnectionOptions connectionOptions)
{
return new QuicConnectionFactory(_connectionStreamInitializersFactory,listenOptions, connectionOptions);
}
}
}
Loading
Loading