Skip to content

Commit eb1bedb

Browse files
committed
upgraded SuperSocket and support net8
1 parent 0c5c955 commit eb1bedb

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v1
1313
- name: Setup .NET Core
14-
uses: actions/setup-dotnet@v1
14+
uses: actions/setup-dotnet@v3
1515
with:
16-
dotnet-version: 7.0.201
16+
dotnet-version: '8.0.x'
1717
- name: Set env
1818
run: |
1919
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV

.github/workflows/myget_release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jobs:
66
steps:
77
- uses: actions/checkout@v1
88
- name: Setup .NET Core
9-
uses: actions/setup-dotnet@v1
9+
uses: actions/setup-dotnet@v3
1010
with:
11-
dotnet-version: 7.0.201
11+
dotnet-version: '8.0.x'
1212
- name: Set env
1313
run: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
1414
- uses: dotnet/nbgv@master

src/SciSharp.MySQL.Replication/ReplicationClient.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Buffers.Binary;
66
using Microsoft.Extensions.Logging;
77
using MySql.Data.MySqlClient;
8-
using SuperSocket.Channel;
8+
using SuperSocket.Connection;
99
using SuperSocket.Client;
1010

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

107107
_connection = mysqlConn;
108108

109-
var channel = new StreamPipeChannel<LogEvent>(_stream, null,
110-
new LogEventPipelineFilter
111-
{
112-
Context = new ReplicationState()
113-
},
114-
new ChannelOptions
115-
{
116-
Logger = Logger
117-
});
118-
119-
SetupChannel(channel);
109+
var connection = new StreamPipeConnection(
110+
stream: _stream,
111+
remoteEndPoint: null,
112+
options: new ConnectionOptions
113+
{
114+
Logger = Logger
115+
});
116+
117+
SetupConnection(connection);
120118
return new LoginResult { Result = true };
121119
}
122120
catch (Exception e)
@@ -167,16 +165,13 @@ private async Task<ChecksumType> GetBinlogChecksum(MySqlConnection mysqlConn)
167165
return (ChecksumType)Enum.Parse(typeof(ChecksumType), checksumTypeName);
168166
}
169167
}
170-
171-
172168

173169
private async ValueTask ConfirmChecksum(MySqlConnection mysqlConn)
174170
{
175171
var cmd = mysqlConn.CreateCommand();
176172
cmd.CommandText = "set @`master_binlog_checksum` = @@binlog_checksum;";
177173
await cmd.ExecuteNonQueryAsync();
178174
}
179-
180175

181176
/*
182177
https://dev.mysql.com/doc/internals/en/com-binlog-dump.html
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.1;net6.0;net7.0</TargetFrameworks>
4-
<LangVersion>8.0</LangVersion>
3+
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
4+
<LangVersion>9.0</LangVersion>
55
</PropertyGroup>
66
<PropertyGroup>
77
<PackageProjectUrl>https://github.com/SciSharp/dotnet-mysql-replication</PackageProjectUrl>
@@ -13,8 +13,8 @@
1313
<Company>SciSharp STACK</Company>
1414
</PropertyGroup>
1515
<ItemGroup>
16-
<PackageReference Include="MySql.Data" Version="8.0.32" />
17-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
18-
<PackageReference Include="SuperSocket.Client" Version="2.0.0-beta.15" />
16+
<PackageReference Include="MySql.Data" Version="8.4.0" />
17+
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
18+
<PackageReference Include="SuperSocket.Client" Version="2.0.0-beta.21" />
1919
</ItemGroup>
2020
</Project>

tests/Test/Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1010
<PackageReference Include="xunit" Version="2.4.0" />
1111
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
1414
</ItemGroup>
1515
<ItemGroup>
1616
<ProjectReference Include="../../src/SciSharp.MySQL.Replication/SciSharp.MySQL.Replication.csproj" />

0 commit comments

Comments
 (0)