This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original thread: 1 | |
Current thread: 3 | |
Value is null | |
Current thread: 5 | |
Value is null | |
Current thread: 5 | |
Value is null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tcp version works properly | |
// TcpEx version (commented lines) crashes | |
using System; | |
using System.Linq; | |
using Zyan.Communication; | |
using Zyan.Communication.Protocols.Tcp; | |
using Zyan.Communication.Security; | |
using Zyan.Communication.SessionMgmt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile this code using: csc example.cs /r:Zyan.Communication.dll | |
// First run — starts server. | |
// Second run — starts client. | |
using System; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Zyan.Communication; | |
using Zyan.Communication.Protocols.Tcp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Server */ | |
// Create component host named "ZyanDemo" and bind to TCP port 8080 | |
var host = new ZyanComponentHost("ZyanDemo", 8080); | |
// Register component type and interface | |
host.RegisterComponent<IHelloWorldService, HelloWordService>(); | |
/* Client */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Connect to server | |
var connection = new ZyanConnection("tcp://localhost:8080/ZyanDemo"); | |
// Create HelloWorldService proxy | |
var proxy = connection.CreateProxy<IHelloWorldService>(); | |
// Invoke method | |
proxy.SayHello("HelloWorld"); | |
// Subscribe to a remote event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create component host named "ZyanDemo" and bind to TCP port 8080 | |
var host = new ZyanComponentHost("ZyanDemo", 8080); | |
// Register component type and interface | |
host.RegisterComponent<IHelloWorldService, HelloWorldService>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
struct Program | |
{ | |
static void Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
struct Program | |
{ | |
static void Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
struct Program | |
{ | |
static void Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
struct Program | |
{ | |
static void Main() | |
{ | |
const int iterations = 100000; |
OlderNewer