diff --git a/.gitignore b/.gitignore index 4dc28c8..fda588b 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ docs/_build/ target/ *.prices +/examples/CSharp/ConsoleApp/ConsoleApp/bin +/examples/CSharp/ConsoleApp/.vs/ +/examples/CSharp/ConsoleApp/ConsoleApp/obj diff --git a/examples/CSharp/ConsoleApp/ConsoleApp.sln b/examples/CSharp/ConsoleApp/ConsoleApp.sln new file mode 100644 index 0000000..43b727e --- /dev/null +++ b/examples/CSharp/ConsoleApp/ConsoleApp.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26430.6 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{D1233DF8-B053-4A50-9297-9FFF2AC03E0B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1233DF8-B053-4A50-9297-9FFF2AC03E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1233DF8-B053-4A50-9297-9FFF2AC03E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1233DF8-B053-4A50-9297-9FFF2AC03E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1233DF8-B053-4A50-9297-9FFF2AC03E0B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/CSharp/ConsoleApp/ConsoleApp/App.config b/examples/CSharp/ConsoleApp/ConsoleApp/App.config new file mode 100644 index 0000000..b50c74f --- /dev/null +++ b/examples/CSharp/ConsoleApp/ConsoleApp/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/CSharp/ConsoleApp/ConsoleApp/ConsoleApp.csproj b/examples/CSharp/ConsoleApp/ConsoleApp/ConsoleApp.csproj new file mode 100644 index 0000000..1ce768e --- /dev/null +++ b/examples/CSharp/ConsoleApp/ConsoleApp/ConsoleApp.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {D1233DF8-B053-4A50-9297-9FFF2AC03E0B} + Exe + ConsoleApp + ConsoleApp + v4.6.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + 4.0.0.1 + + + + \ No newline at end of file diff --git a/examples/CSharp/ConsoleApp/ConsoleApp/Program.cs b/examples/CSharp/ConsoleApp/ConsoleApp/Program.cs new file mode 100644 index 0000000..8de8459 --- /dev/null +++ b/examples/CSharp/ConsoleApp/ConsoleApp/Program.cs @@ -0,0 +1,35 @@ +using NetMQ.Sockets; +using NetMQ; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ionic.Zlib; + +namespace ConsoleApp +{ + class Program + { + static void Main(string[] args) + { + var utf8 = new UTF8Encoding(); + + using (var client = new SubscriberSocket()) + { + client.Options.ReceiveHighWatermark = 1000; + client.Connect("tcp://eddn-relay.elite-markets.net:9500"); + client.SubscribeToAnyTopic(); + while (true) + { + var bytes = client.ReceiveFrameBytes(); + var uncompressed = ZlibStream.UncompressBuffer(bytes); + + var result = utf8.GetString(uncompressed); + + Console.WriteLine(result); + } + } + } + } +} diff --git a/examples/CSharp/ConsoleApp/ConsoleApp/Properties/AssemblyInfo.cs b/examples/CSharp/ConsoleApp/ConsoleApp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1c75aba --- /dev/null +++ b/examples/CSharp/ConsoleApp/ConsoleApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ConsoleApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ConsoleApp")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d1233df8-b053-4a50-9297-9fff2ac03e0b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]