Skip to content

Commit

Permalink
housekeeping: Update to .net6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Nov 9, 2021
1 parent 91ac671 commit e9ba240
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 29 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Install dotnet-format
run: dotnet tool update -g dotnet-format
dotnet-version: 6.0.x

- name: Checkout code
uses: actions/checkout@v2

- name: Run dotnet format check
run: dotnet format -wsa -v diag --check
run: dotnet format -v diag --verify-no-changes

test:
name: Test
Expand All @@ -34,7 +31,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x

- name: Test
shell: pwsh
Expand Down Expand Up @@ -63,7 +60,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x

- name: Build
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion HttpProxy/HttpProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Pipelines.Extensions/Pipelines.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.0.63" />
<PackageReference Include="System.IO.Pipelines" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.0.64" />
<PackageReference Include="System.IO.Pipelines" Version="6.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Shadowsocks.Crypto/Shadowsocks.Crypto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoBase" Version="1.5.1" />
<PackageReference Include="CryptoBase" Version="1.6.0" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions Shadowsocks.Protocol/ListenServices/UdpListenService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public async ValueTask StartAsync()
UdpListener.Client.Bind(_local);
_logger.LogInformation(@"{LoggerHeader} {Local} Start", LoggerHeader, UdpListener.Client.LocalEndPoint);

while (!_cts.IsCancellationRequested)
while (true)
{
//TODO .NET6.0
var message = await UdpListener.ReceiveAsync();
var message = await UdpListener.ReceiveAsync(_cts.Token);
#if DEBUG
_logger.LogDebug(
@"{LoggerHeader}: {ReceiveLength} bytes {Remote} => {Local}",
Expand Down
6 changes: 3 additions & 3 deletions Shadowsocks.Protocol/LocalUdpServices/Socks5UdpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public async ValueTask HandleAsync(UdpReceiveResult receiveResult, UdpClient inc
var receiveLength = await client.ReceiveAsync(receiveBuffer.AsMemory(3), cancellationToken);
receiveBuffer.AsSpan(0, 3).Clear();

//TODO .NET6.0
await incoming.Client.SendToAsync(
new ArraySegment<byte>(receiveBuffer, 0, 3 + receiveLength),
receiveBuffer.AsMemory(0, 3 + receiveLength),
SocketFlags.None,
receiveResult.RemoteEndPoint
receiveResult.RemoteEndPoint,
cancellationToken
);
}
finally
Expand Down
4 changes: 2 additions & 2 deletions Shadowsocks.Protocol/Shadowsocks.Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 5 additions & 6 deletions Socks5/Servers/SimpleSocks5UdpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ public async ValueTask StartAsync()
{
try
{
while (!_cts.IsCancellationRequested)
while (true)
{
//TODO .NET6.0
var message = await UdpListener.ReceiveAsync();
var message = await UdpListener.ReceiveAsync(_cts.Token);
if (Equals(message.RemoteEndPoint.Address, _remoteEndpoint.Address))
{
await HandleAsync(message, _cts.Token);
Expand Down Expand Up @@ -88,11 +87,11 @@ private async ValueTask HandleAsync(UdpReceiveResult result, CancellationToken t
var receiveLength = await client.Client.ReceiveAsync(receiveBuffer.AsMemory(headerLength), SocketFlags.None, token);
result.Buffer.AsSpan(0, headerLength).CopyTo(receiveBuffer);

//TODO .NET6.0
await UdpListener.Client.SendToAsync(
new ArraySegment<byte>(receiveBuffer, 0, headerLength + receiveLength),
receiveBuffer.AsMemory(0, headerLength + receiveLength),
SocketFlags.None,
result.RemoteEndPoint
result.RemoteEndPoint,
token
);
}
finally
Expand Down
4 changes: 2 additions & 2 deletions TestConsoleApp/TestConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion UnitTest/UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.1.0" PrivateAssets="all" />
Expand Down
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Authors>HMBSbige</Authors>
Expand Down

0 comments on commit e9ba240

Please sign in to comment.