Skip to content

Commit

Permalink
Migrated basic RPC features of Zyan to .NET Standard 2.0 (runs on .NE…
Browse files Browse the repository at this point in the history
…T 5)

- This is just the first step. Don't use this in production!
- See HelloZyanDotNet5 example for testing basic RPC with Zyan on .NET 5
- The following features are currently BROKEN:
-- InterLinq support
-- Delegate / event support
-- Authentication
-- Call interception
  • Loading branch information
theRainbird committed Jun 29, 2021
1 parent 4e211bf commit 0aca4ad
Show file tree
Hide file tree
Showing 124 changed files with 6,524 additions and 16,948 deletions.
13 changes: 13 additions & 0 deletions source/.idea/.idea.Zyan/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions source/.idea/.idea.Zyan/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions source/.idea/.idea.Zyan/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions source/.idea/.idea.Zyan/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions source/.idea/.idea.Zyan/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions source/.idea/.idea.Zyan/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Zyan.Communication\Zyan.Communication.csproj" />
<ProjectReference Include="..\HelloZyanDotNet5.Shared\HelloZyanDotNet5.Shared.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using HelloZyanDotNet5.Shared;
using Zyan.Communication;
using Zyan.Communication.Protocols.Websocket;

namespace HelloZyanDotNet5.Client
{
internal static class Program
{
public static void Main(string[] args)
{
using var connection = new ZyanConnection(
serverUrl: "http://localhost:9091/HelloZyan.Server",
protocolSetup: new WebsocketClientProtocolSetup
{
ServerTcpPort = 9091,
ServerHostName = "localhost",
MessageEncryption = false,
KeySize = 4096
});

var helloServiceProxy = connection.CreateProxy<IHelloService>();

Console.Write("What's your name:");
var name = Console.ReadLine();

var greeting = helloServiceProxy.Greet(name);

Console.WriteLine(greeting);
Console.ReadLine();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using HelloZyanDotNet5.Shared;

namespace HelloZyanDotNet5.Server
{
public class HelloService : IHelloService
{
public string Greet(string name)
{
return $"Hello, {name}.";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Zyan.Communication\Zyan.Communication.csproj" />
<ProjectReference Include="..\HelloZyanDotNet5.Shared\HelloZyanDotNet5.Shared.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using HelloZyanDotNet5.Shared;
using Zyan.Communication;
using Zyan.Communication.Protocols.Websocket;
using Zyan.Communication.Security;

namespace HelloZyanDotNet5.Server
{
internal static class Program
{
public static void Main(string[] args)
{
using var host = new ZyanComponentHost(
name: "HelloZyan.Server",
protocolSetup: new WebsocketServerProtocolSetup
{
NetworkHostName = "localhost",
TcpPort = 9091,
MessageEncryption = false,
KeySize = 4096,
AuthenticationProvider = new NullAuthenticationProvider()
});

host.ComponentCatalog.RegisterComponent<IHelloService, HelloService>();

Console.WriteLine("Server is running. Press [Enter] to quit.");
Console.ReadLine();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace HelloZyanDotNet5.Shared
{
public interface IHelloService
{
string Greet(string name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand All @@ -71,6 +72,7 @@
<Compile Include="TcpDuplexTest.cs" />
<Compile Include="TestAppCode.cs" />
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Zyan.Communication\Zyan.Communication.csproj">
Expand Down
4 changes: 4 additions & 0 deletions source/IntegrationTest_DistributedEvents/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ComponentModel.Composition" version="5.0.0" targetFramework="net46" />
</packages>
3 changes: 1 addition & 2 deletions source/Zyan.Communication/CallContextData.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using System.Collections;
using System.Runtime.Remoting.Messaging;

namespace Zyan.Communication
{
/// <summary>
/// Stores data that travels with the call context from client to server and back.
/// </summary>
[Serializable]
public class LogicalCallContextData : ILogicalThreadAffinative
public class LogicalCallContextData
{
// Data store
private Hashtable _store = null;
Expand Down
Loading

0 comments on commit 0aca4ad

Please sign in to comment.