Skip to content

Commit

Permalink
upgraded SuperSocket and support net8
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed May 15, 2024
1 parent 0c5c955 commit eb1bedb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.201
dotnet-version: '8.0.x'
- name: Set env
run: |
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/myget_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.201
dotnet-version: '8.0.x'
- name: Set env
run: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
- uses: dotnet/nbgv@master
Expand Down
25 changes: 10 additions & 15 deletions src/SciSharp.MySQL.Replication/ReplicationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Buffers.Binary;
using Microsoft.Extensions.Logging;
using MySql.Data.MySqlClient;
using SuperSocket.Channel;
using SuperSocket.Connection;
using SuperSocket.Client;

namespace SciSharp.MySQL.Replication
Expand Down Expand Up @@ -106,17 +106,15 @@ public async Task<LoginResult> ConnectAsync(string server, string username, stri

_connection = mysqlConn;

var channel = new StreamPipeChannel<LogEvent>(_stream, null,
new LogEventPipelineFilter
{
Context = new ReplicationState()
},
new ChannelOptions
{
Logger = Logger
});

SetupChannel(channel);
var connection = new StreamPipeConnection(
stream: _stream,
remoteEndPoint: null,
options: new ConnectionOptions
{
Logger = Logger
});

SetupConnection(connection);
return new LoginResult { Result = true };
}
catch (Exception e)
Expand Down Expand Up @@ -167,16 +165,13 @@ private async Task<ChecksumType> GetBinlogChecksum(MySqlConnection mysqlConn)
return (ChecksumType)Enum.Parse(typeof(ChecksumType), checksumTypeName);
}
}



private async ValueTask ConfirmChecksum(MySqlConnection mysqlConn)
{
var cmd = mysqlConn.CreateCommand();
cmd.CommandText = "set @`master_binlog_checksum` = @@binlog_checksum;";
await cmd.ExecuteNonQueryAsync();
}


/*
https://dev.mysql.com/doc/internals/en/com-binlog-dump.html
Expand Down
10 changes: 5 additions & 5 deletions src/SciSharp.MySQL.Replication/SciSharp.MySQL.Replication.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net6.0;net7.0</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<PackageProjectUrl>https://github.com/SciSharp/dotnet-mysql-replication</PackageProjectUrl>
Expand All @@ -13,8 +13,8 @@
<Company>SciSharp STACK</Company>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MySql.Data" Version="8.0.32" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="SuperSocket.Client" Version="2.0.0-beta.15" />
<PackageReference Include="MySql.Data" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="SuperSocket.Client" Version="2.0.0-beta.21" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions tests/Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/SciSharp.MySQL.Replication/SciSharp.MySQL.Replication.csproj" />
Expand Down

0 comments on commit eb1bedb

Please sign in to comment.