Skip to content

Commit

Permalink
add quic
Browse files Browse the repository at this point in the history
  • Loading branch information
wj8400684 committed May 3, 2024
1 parent e3ed393 commit f4bb0a2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/SuperSocket.Quic/QuicConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Quic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -15,7 +14,6 @@ namespace SuperSocket.Quic
{
internal class QuicConnectionFactory : IConnectionFactory
{
private readonly ILogger _logger;
private readonly ListenOptions _listenOptions;
private readonly ConnectionOptions _connectionOptions;
private readonly IEnumerable<IConnectionStreamInitializer> _connectionStreamInitializers;
Expand All @@ -27,7 +25,6 @@ public QuicConnectionFactory(
{
_listenOptions = listenOptions;
_connectionOptions = connectionOptions;
_logger = connectionOptions.Logger;
_connectionStreamInitializers = connectionStreamInitializersFactory.Create(_listenOptions);
}

Expand All @@ -48,4 +45,3 @@ public async Task<IConnection> CreateConnection(object connection, CancellationT
}
}
}
#pragma warning restore CA2252
1 change: 0 additions & 1 deletion src/SuperSocket.Quic/QuicConnectionListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,3 @@ public override string ToString()
}
}
}
#pragma warning restore CA2252
6 changes: 2 additions & 4 deletions src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Net.Quic;
using Microsoft.Extensions.DependencyInjection;
using SuperSocket.Server.Abstractions.Connections;
Expand All @@ -13,8 +12,8 @@ public static class QuicServerHostBuilderExtensions
{
public static ISuperSocketHostBuilder UseQuic(this ISuperSocketHostBuilder hostBuilder)
{
// if (!QuicListener.IsSupported)
// throw new PlatformNotSupportedException("System.Net.Quic is not supported on this platform.");
if (!QuicListener.IsSupported)

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

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

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

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

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

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

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

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

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

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

Check warning on line 15 in src/SuperSocket.Quic/QuicServerHostBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

This call site is reachable on all platforms. 'QuicListener.IsSupported' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
throw new PlatformNotSupportedException("System.Net.Quic is not supported on this platform.");

return hostBuilder.ConfigureServices((_, services) =>
{
Expand All @@ -30,4 +29,3 @@ public static ISuperSocketHostBuilder<TReceivePackage> UseQuic<TReceivePackage>(
}
}
}
#pragma warning disable CA2252

0 comments on commit f4bb0a2

Please sign in to comment.