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: "c:\Program Files (x86)\MSBuild\14.0\Bin\csc.exe" ParseCsv.cs /r:CsvHelper.dll | |
// Depends on: https://www.nuget.org/packages/CsvHelper/ | |
// Source code: http://joshclose.github.io/CsvHelper/#change-log | |
using System; | |
using System.IO; | |
using System.Xml; | |
using System.Xml.Linq; | |
using CsvHelper; |
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 ipctest.cs /r:Zyan.Communication.dll | |
// First run — starts server. | |
// Second run — starts client. | |
using System; | |
using System.Linq; | |
using System.Text; | |
using Zyan.Communication; | |
using Zyan.Communication.Protocols.Ipc; |
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: csc service.cs /r:Zyan.Communication.dll /r:Topshelf.dll | |
// | |
// Usage: | |
// service.exe Run the console server | |
// service.exe install Install the service (requires admin rights) | |
// service.exe start Start the installed service (admin) | |
// service.exe stop Stops the service (admin) | |
// service.exe uninstall Uninstall the service (admin) | |
// service.exe client Run the console 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
// 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
// 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
// http://zyan.com.de | |
// | |
// Compile using: csc test.cs /r:Zyan.Communication.dll | |
// | |
// Disconnected/Reconnected events demo usage scenario. | |
// | |
// Start up test.exe several times. | |
// The first process is the server, the rest are clients. | |
// The server prints polling events to the console once in a second. | |
// |
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
// Zyan + EF6 concurrent data access example. | |
// Written by Alexey Yakovlev <yallie@yandex.ru> | |
// Compile this code using: | |
// | |
// csc eftest3.cs /r:Zyan.Communication.dll /r:EntityFramework.dll /r:EntityFramework.SqlServerCompact.dll /r:System.ComponentModel.DataAnnotations.dll | |
// | |
// First run — starts server. | |
// Second run — starts client. | |
using System; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | |
</configSections> | |
<entityFramework> | |
<providers> | |
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" /> | |
</providers> | |
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"> |
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 streams.cs /r:Zyan.Communication.dll | |
// | |
// First run — starts server. | |
// Second run — starts client. | |
using System; | |
using System.IO; | |
using System.Net.Sockets; |