Permalink
Browse files

Works on Server-Client Unary.

  • Loading branch information...
1 parent 2b52d24 commit 2d49716333266e620c8beae7ca86c9ffdb43b3bc @neuecc committed Dec 10, 2016
Showing with 7,180 additions and 2 deletions.
  1. +63 −0 .gitattributes
  2. +111 −0 .gitignore
  3. +66 −0 MagicOnion.sln
  4. +5 −2 README.md
  5. BIN libz.exe
  6. +6 −0 sandbox/Sandbox.ConsoleClient/App.config
  7. +42 −0 sandbox/Sandbox.ConsoleClient/Program.cs
  8. +36 −0 sandbox/Sandbox.ConsoleClient/Properties/AssemblyInfo.cs
  9. +96 −0 sandbox/Sandbox.ConsoleClient/Sandbox.ConsoleClient.csproj
  10. +8 −0 sandbox/Sandbox.ConsoleClient/packages.config
  11. +6 −0 sandbox/Sandbox.ConsoleServer/App.config
  12. +30 −0 sandbox/Sandbox.ConsoleServer/Program.cs
  13. +36 −0 sandbox/Sandbox.ConsoleServer/Properties/AssemblyInfo.cs
  14. +97 −0 sandbox/Sandbox.ConsoleServer/Sandbox.ConsoleServer.csproj
  15. +29 −0 sandbox/Sandbox.ConsoleServer/Services/MyFirstService.cs
  16. +8 −0 sandbox/Sandbox.ConsoleServer/packages.config
  17. +15 −0 sandbox/Sandbox.ConsoleServerDefinition/IMyFirstService.cs
  18. +36 −0 sandbox/Sandbox.ConsoleServerDefinition/Properties/AssemblyInfo.cs
  19. +64 −0 sandbox/Sandbox.ConsoleServerDefinition/Sandbox.ConsoleServerDefinition.csproj
  20. +1 −0 sandbox/SharedLibrary/Class1.cs
  21. +36 −0 sandbox/SharedLibrary/Properties/AssemblyInfo.cs
  22. +58 −0 sandbox/SharedLibrary/SharedLibrary.csproj
  23. +5 −0 sandbox/SharedLibrary/packages.config
  24. +7 −0 src/MagicOnion.Interfaces/IService.cs
  25. +50 −0 src/MagicOnion.Interfaces/MagicOnion.Interfaces.csproj
  26. +36 −0 src/MagicOnion.Interfaces/Properties/AssemblyInfo.cs
  27. +390 −0 src/MagicOnion/Client/DynamicClientBuilder.cs
  28. +38 −0 src/MagicOnion/Client/MagicOnionClient.cs
  29. +55 −0 src/MagicOnion/Client/MagicOnionClientBase.cs
  30. +3,539 −0 src/MagicOnion/DynamicArgumentTuple.cs
  31. +141 −0 src/MagicOnion/DynamicArgumentTuple.tt
  32. +21 −0 src/MagicOnion/IService.cs
  33. +109 −0 src/MagicOnion/MagicOnion.csproj
  34. +221 −0 src/MagicOnion/MagicOnionMarshallers.cs
  35. +36 −0 src/MagicOnion/Properties/AssemblyInfo.cs
  36. +94 −0 src/MagicOnion/Server/MagicOnionEngine.cs
  37. +25 −0 src/MagicOnion/Server/MagicOnionOptions.cs
  38. +244 −0 src/MagicOnion/Server/MethodHandler.cs
  39. +81 −0 src/MagicOnion/Server/Service.cs
  40. +48 −0 src/MagicOnion/Server/ServiceContext.cs
  41. +90 −0 src/MagicOnion/UnaryResult.cs
  42. +22 −0 src/MagicOnion/Utils/DynamicAssembly.cs
  43. +165 −0 src/MagicOnion/Utils/ILGeneratorExtensions.cs
  44. +8 −0 src/MagicOnion/packages.config
  45. +726 −0 tests/MagicOnion.Tests/ChainingAssertion.xUnit.cs
  46. +18 −0 tests/MagicOnion.Tests/Class1.cs
  47. +110 −0 tests/MagicOnion.Tests/MagicOnion.Tests.csproj
  48. +36 −0 tests/MagicOnion.Tests/Properties/AssemblyInfo.cs
  49. +16 −0 tests/MagicOnion.Tests/packages.config
View
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
View
@@ -0,0 +1,111 @@
+# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
+[Bb]in/
+[Oo]bj/
+
+# mstest test results
+TestResults
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+*_i.c
+*_p.c
+*.ilk
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.log
+*.vspscc
+*.vssscc
+.builds
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Publish Web Output
+*.Publish.xml
+
+# NuGet Packages Directory
+packages
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+[Tt]est[Rr]esult*
+*.Cache
+ClientBin
+[Ss]tyle[Cc]op.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+.vs/config/applicationhost.config
+.vs/restore.dg
+
+# Unity
View
@@ -0,0 +1,66 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1987061F-8970-4018-8D58-6932961C9EB4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sandbox", "sandbox", "{7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.Tests", "tests\MagicOnion.Tests\MagicOnion.Tests.csproj", "{879C8453-8995-4D9A-964F-2FEA2B84FF1A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion", "src\MagicOnion\MagicOnion.csproj", "{C79CE0BF-ED4C-47BE-822E-E82CF83FC68A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox.ConsoleClient", "sandbox\Sandbox.ConsoleClient\Sandbox.ConsoleClient.csproj", "{59C4CF2E-964B-460A-BCCA-33F434DD11EF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox.ConsoleServer", "sandbox\Sandbox.ConsoleServer\Sandbox.ConsoleServer.csproj", "{A6F79DDC-B0FF-4337-9B24-8D5E768A8340}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedLibrary", "sandbox\SharedLibrary\SharedLibrary.csproj", "{6BDE33A5-2744-40E5-8999-BF0465745587}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox.ConsoleServerDefinition", "sandbox\Sandbox.ConsoleServerDefinition\Sandbox.ConsoleServerDefinition.csproj", "{26D5411C-460A-489A-A1E8-B7CC0B4D05BB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {879C8453-8995-4D9A-964F-2FEA2B84FF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {879C8453-8995-4D9A-964F-2FEA2B84FF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {879C8453-8995-4D9A-964F-2FEA2B84FF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {879C8453-8995-4D9A-964F-2FEA2B84FF1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C79CE0BF-ED4C-47BE-822E-E82CF83FC68A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C79CE0BF-ED4C-47BE-822E-E82CF83FC68A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C79CE0BF-ED4C-47BE-822E-E82CF83FC68A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C79CE0BF-ED4C-47BE-822E-E82CF83FC68A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59C4CF2E-964B-460A-BCCA-33F434DD11EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59C4CF2E-964B-460A-BCCA-33F434DD11EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59C4CF2E-964B-460A-BCCA-33F434DD11EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59C4CF2E-964B-460A-BCCA-33F434DD11EF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A6F79DDC-B0FF-4337-9B24-8D5E768A8340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A6F79DDC-B0FF-4337-9B24-8D5E768A8340}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A6F79DDC-B0FF-4337-9B24-8D5E768A8340}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A6F79DDC-B0FF-4337-9B24-8D5E768A8340}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6BDE33A5-2744-40E5-8999-BF0465745587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6BDE33A5-2744-40E5-8999-BF0465745587}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6BDE33A5-2744-40E5-8999-BF0465745587}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6BDE33A5-2744-40E5-8999-BF0465745587}.Release|Any CPU.Build.0 = Release|Any CPU
+ {26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {879C8453-8995-4D9A-964F-2FEA2B84FF1A} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0}
+ {C79CE0BF-ED4C-47BE-822E-E82CF83FC68A} = {1987061F-8970-4018-8D58-6932961C9EB4}
+ {59C4CF2E-964B-460A-BCCA-33F434DD11EF} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
+ {A6F79DDC-B0FF-4337-9B24-8D5E768A8340} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
+ {6BDE33A5-2744-40E5-8999-BF0465745587} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
+ {26D5411C-460A-489A-A1E8-B7CC0B4D05BB} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
+ EndGlobalSection
+EndGlobal
View
@@ -1,2 +1,5 @@
-# MagicOnion
-gRPC based HTTP2 RPC Streaming Framework for .NET, .NET Core, Unity
+MagicOnion
+===
+gRPC based HTTP2 RPC Streaming Framework for .NET, .NET Core and Unity.
+
+Work in progress, stay tuned.
View
Binary file not shown.
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+ </startup>
+</configuration>
@@ -0,0 +1,42 @@
+using Grpc.Core;
+using MagicOnion.Client;
+using Sandbox.ConsoleServer;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MagicOnion.ConsoleClient
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Run().GetAwaiter().GetResult();
+ }
+
+ static async Task Run()
+ {
+ try
+ {
+ var channel = new Channel("localhost", 12345, ChannelCredentials.Insecure);
+ await channel.ConnectAsync();
+
+ var c = MagicOnionClient.Create<IMyFirstService>(channel);
+
+ //var huga = c.GetFeatureAsync(10, 20);
+
+ var vvvvv = await await c.SumAsync(10, 20);
+ Console.WriteLine("SumAsync:" + vvvvv);
+
+ var v2 = await c.SumAsync2(999, 1000);
+ Console.WriteLine("v2:" + v2);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex);
+ }
+ }
+ }
+}
@@ -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("MagicOnion.ConsoleClient")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MagicOnion.ConsoleClient")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[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("59c4cf2e-964b-460a-bcca-33f434dd11ef")]
+
+// 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")]
Oops, something went wrong.

0 comments on commit 2d49716

Please sign in to comment.