Skip to content

Commit

Permalink
Merge pull request #42 from dotnet-campus/t/walterlv/squash
Browse files Browse the repository at this point in the history
Fix many many bugs and add many many APIs for the IPC
  • Loading branch information
lindexi authored Dec 6, 2021
2 parents d79cd66 + 6f99695 commit 2eb7f6b
Show file tree
Hide file tree
Showing 150 changed files with 5,671 additions and 1,464 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/nuget-tag-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:

steps:
- uses: actions/checkout@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300

- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
Expand Down
7 changes: 4 additions & 3 deletions demo/dotnetCampus.Ipc.Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using System.Reflection;
using System.Text.Json;
using System.Threading.Tasks;
using dotnetCampus.Ipc.PipeCore;
using dotnetCampus.Ipc.PipeCore.Context;

using dotnetCampus.Ipc.Context;
using dotnetCampus.Ipc.Pipes;

namespace dotnetCampus.Ipc.Demo
{
Expand Down Expand Up @@ -59,7 +60,7 @@ private static void Main(string[] args)

//Console.WriteLine(string.Join(",", Encoding.UTF8.GetBytes("ACK").Select(temp => "0x" + temp.ToString("X2"))));
//var byteList = BitConverter.GetBytes((ulong) 100);
//Console.WriteLine(sizeof(ulong));
//Console.WriteLine(sizeof(ulong));

//var peerRegisterProviderTests = new PeerRegisterProviderTests();
//peerRegisterProviderTests.Run();
Expand Down
5 changes: 3 additions & 2 deletions demo/dotnetCampus.Ipc.Demo/dotnetCampus.Ipc.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\dotnetCampus.Ipc.PipeCore\dotnetCampus.Ipc.PipeCore.csproj" />
<ProjectReference Include="..\..\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>

Expand Down
8 changes: 5 additions & 3 deletions demo/dotnetCampus.Ipc.WpfDemo/ConnectedPeerModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
using System.Collections.ObjectModel;
using System.IO;
using System.Windows.Threading;
using dotnetCampus.Ipc.Abstractions;
using dotnetCampus.Ipc.PipeCore;

using dotnetCampus.Ipc.Context;
using dotnetCampus.Ipc.Messages;
using dotnetCampus.Ipc.Pipes;

namespace dotnetCampus.Ipc.WpfDemo
{
Expand All @@ -22,7 +24,7 @@ public ConnectedPeerModel(PeerProxy peer)

private void Peer_MessageReceived(object? sender, IPeerMessageArgs e)
{
var streamReader = new StreamReader(e.Message);
var streamReader = new StreamReader(e.Message.Body.ToMemoryStream());
var message = streamReader.ReadToEnd();

Dispatcher.InvokeAsync(() =>
Expand Down
21 changes: 18 additions & 3 deletions demo/dotnetCampus.Ipc.WpfDemo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using dotnetCampus.Ipc.Abstractions;
using dotnetCampus.Ipc.Abstractions.Context;
using dotnetCampus.Ipc.PipeCore;

using dotnetCampus.Ipc.Context;
using dotnetCampus.Ipc.Pipes;
using dotnetCampus.Ipc.WpfDemo.View;

using Walterlv.ThreadSwitchingTasks;

namespace dotnetCampus.Ipc.WpfDemo
Expand Down Expand Up @@ -76,7 +77,21 @@ private void StartServer(string serverName)
ServerNameTextBox.Text = serverName;
}


/* 项目“dotnetCampus.Ipc.WpfDemo (net45)”的未合并的更改
在此之前:
private void IpcProvider_PeerConnected(object? sender, PipeCore.Context.PeerConnectedArgs e)
在此之后:
private void IpcProvider_PeerConnected(object? sender, PeerConnectedArgs e)
*/

/* 项目“dotnetCampus.Ipc.WpfDemo (net45)”的未合并的更改
在此之前:
private void IpcProvider_PeerConnected(object? sender, Context.EventArgs.PeerConnectedArgs e)
在此之后:
private void IpcProvider_PeerConnected(object? sender, PeerConnectedArgs e)
*/
private void IpcProvider_PeerConnected(object? sender, Context.PeerConnectedArgs e)
{
AddPeer(e.Peer);
}
Expand Down
6 changes: 4 additions & 2 deletions demo/dotnetCampus.Ipc.WpfDemo/dotnetCampus.Ipc.WpfDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<TargetFrameworks>netcoreapp3.1;net45</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
</PropertyGroup>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dotnetCampus.CommandLine" Version="3.3.0" />
<ProjectReference Include="..\..\src\dotnetCampus.Ipc.PipeCore\dotnetCampus.Ipc.PipeCore.csproj" />
<ProjectReference Include="..\..\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>

</Project>
37 changes: 2 additions & 35 deletions dotnetCampus.Ipc.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30523.141
VisualStudioVersion = 16.0.31729.503
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5D196596-756D-45C2-8A05-C8E4AB8A36E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc", "src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj", "{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C0B9B0B5-D172-4309-A8C4-2C8B77E470CD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc.Tests", "tests\dotnetCampus.Ipc.Tests\dotnetCampus.Ipc.Tests.csproj", "{E007FBCE-2F83-499F-9060-7D1FB673E24B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc.PipeCore", "src\dotnetCampus.Ipc.PipeCore\dotnetCampus.Ipc.PipeCore.csproj", "{AA3EB068-A211-43C4-955D-F54C4EC9E492}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc.Abstractions", "src\dotnetCampus.Ipc.Abstractions\dotnetCampus.Ipc.Abstractions.csproj", "{DD4F9A11-F789-4D0D-B581-718B1046661B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc.Demo", "demo\dotnetCampus.Ipc.Demo\dotnetCampus.Ipc.Demo.csproj", "{4D078B2A-029B-4B53-8FA9-5D2F9330BC72}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{65FA7B8E-7D2E-41D1-9740-BBB7D8B8ABE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetCampus.Ipc.WpfDemo", "demo\dotnetCampus.Ipc.WpfDemo\dotnetCampus.Ipc.WpfDemo.csproj", "{0E10A5EB-7E48-408A-A4E7-8AB2A7AF143A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.Ipc.WpfDemo", "demo\dotnetCampus.Ipc.WpfDemo\dotnetCampus.Ipc.WpfDemo.csproj", "{0E10A5EB-7E48-408A-A4E7-8AB2A7AF143A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -55,30 +49,6 @@ Global
{E007FBCE-2F83-499F-9060-7D1FB673E24B}.Release|x64.Build.0 = Release|Any CPU
{E007FBCE-2F83-499F-9060-7D1FB673E24B}.Release|x86.ActiveCfg = Release|Any CPU
{E007FBCE-2F83-499F-9060-7D1FB673E24B}.Release|x86.Build.0 = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|x64.ActiveCfg = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|x64.Build.0 = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|x86.ActiveCfg = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Debug|x86.Build.0 = Debug|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|Any CPU.Build.0 = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|x64.ActiveCfg = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|x64.Build.0 = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|x86.ActiveCfg = Release|Any CPU
{AA3EB068-A211-43C4-955D-F54C4EC9E492}.Release|x86.Build.0 = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|x64.ActiveCfg = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|x64.Build.0 = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|x86.ActiveCfg = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Debug|x86.Build.0 = Debug|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|Any CPU.Build.0 = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|x64.ActiveCfg = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|x64.Build.0 = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|x86.ActiveCfg = Release|Any CPU
{DD4F9A11-F789-4D0D-B581-718B1046661B}.Release|x86.Build.0 = Release|Any CPU
{4D078B2A-029B-4B53-8FA9-5D2F9330BC72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D078B2A-029B-4B53-8FA9-5D2F9330BC72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D078B2A-029B-4B53-8FA9-5D2F9330BC72}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -108,10 +78,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272} = {5D196596-756D-45C2-8A05-C8E4AB8A36E6}
{E007FBCE-2F83-499F-9060-7D1FB673E24B} = {C0B9B0B5-D172-4309-A8C4-2C8B77E470CD}
{AA3EB068-A211-43C4-955D-F54C4EC9E492} = {5D196596-756D-45C2-8A05-C8E4AB8A36E6}
{DD4F9A11-F789-4D0D-B581-718B1046661B} = {5D196596-756D-45C2-8A05-C8E4AB8A36E6}
{4D078B2A-029B-4B53-8FA9-5D2F9330BC72} = {65FA7B8E-7D2E-41D1-9740-BBB7D8B8ABE3}
{0E10A5EB-7E48-408A-A4E7-8AB2A7AF143A} = {65FA7B8E-7D2E-41D1-9740-BBB7D8B8ABE3}
EndGlobalSection
Expand Down

This file was deleted.

51 changes: 0 additions & 51 deletions src/dotnetCampus.Ipc.Abstractions/Context/IpcBufferMessage.cs

This file was deleted.

22 changes: 0 additions & 22 deletions src/dotnetCampus.Ipc.Abstractions/IMessageWriter.cs

This file was deleted.

46 changes: 0 additions & 46 deletions src/dotnetCampus.Ipc.Abstractions/IpcMessageWriter.cs

This file was deleted.

41 changes: 0 additions & 41 deletions src/dotnetCampus.Ipc.Abstractions/IpcRequestMessage.cs

This file was deleted.

Loading

0 comments on commit 2eb7f6b

Please sign in to comment.