-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
…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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="System.ComponentModel.Composition" version="5.0.0" targetFramework="net46" /> | ||
</packages> |