├── .gitattributes ├── .gitignore ├── client ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── client.csproj ├── models │ ├── Dummy.cs │ ├── DummyGrpc.cs │ ├── Greeting.cs │ └── GreetingGrpc.cs └── packages.config ├── dummy.proto ├── greeting.proto ├── grpc-csharp-class.sln ├── server ├── App.config ├── GreetingServiceImpl.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── models │ ├── Dummy.cs │ ├── DummyGrpc.cs │ ├── Greeting.cs │ └── GreetingGrpc.cs ├── packages.config └── server.csproj └── ssl └── ssl.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /client/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Greet; 5 | using Grpc.Core; 6 | 7 | namespace client 8 | { 9 | internal class Program 10 | { 11 | private const string target = "127.0.0.1:50051"; 12 | 13 | private static async Task Main(string[] args) 14 | { 15 | //var clientCert = File.ReadAllText("ssl/client.crt"); 16 | //var clientKey = File.ReadAllText("ssl/client.key"); 17 | //var caCrt = File.ReadAllText("ssl/ca.crt"); 18 | 19 | //var channelCredentials = new SslCredentials(caCrt, new KeyCertificatePair(clientCert, clientKey)); 20 | 21 | var channel = new Channel("localhost", 50051, ChannelCredentials.Insecure); // channelCredentials); 22 | 23 | await channel.ConnectAsync().ContinueWith(task => 24 | { 25 | if (task.Status == TaskStatus.RanToCompletion) 26 | Console.WriteLine("The client connected successfully"); 27 | }); 28 | 29 | var client = new GreetingService.GreetingServiceClient(channel); 30 | 31 | DoSimpleGreet(client); 32 | //await DoManyGreetings(client); 33 | //await DoLongGreet(client); 34 | //await DoGreetEveryone(client); 35 | 36 | channel.ShutdownAsync().Wait(); 37 | Console.ReadKey(); 38 | } 39 | 40 | public static void DoSimpleGreet(GreetingService.GreetingServiceClient client) 41 | { 42 | var greeting = new Greeting 43 | { 44 | FirstName = "Clement", 45 | LastName = "Jean" 46 | }; 47 | 48 | var request = new GreetingRequest {Greeting = greeting}; 49 | var response = client.Greet(request); 50 | 51 | Console.WriteLine(response.Result); 52 | } 53 | 54 | public static async Task DoManyGreetings(GreetingService.GreetingServiceClient client) 55 | { 56 | var greeting = new Greeting 57 | { 58 | FirstName = "Clement", 59 | LastName = "Jean" 60 | }; 61 | 62 | var request = new GreetManyTimesRequest {Greeting = greeting}; 63 | var response = client.GreetManyTimes(request); 64 | 65 | while (await response.ResponseStream.MoveNext()) 66 | { 67 | Console.WriteLine(response.ResponseStream.Current.Result); 68 | await Task.Delay(200); 69 | } 70 | } 71 | 72 | public static async Task DoLongGreet(GreetingService.GreetingServiceClient client) 73 | { 74 | var greeting = new Greeting 75 | { 76 | FirstName = "Clement", 77 | LastName = "Jean" 78 | }; 79 | 80 | var request = new LongGreetRequest {Greeting = greeting}; 81 | var stream = client.LongGreet(); 82 | 83 | foreach (int i in Enumerable.Range(1, 10)) await stream.RequestStream.WriteAsync(request); 84 | 85 | await stream.RequestStream.CompleteAsync(); 86 | 87 | var response = await stream.ResponseAsync; 88 | 89 | Console.WriteLine(response.Result); 90 | } 91 | 92 | public static async Task DoGreetEveryone(GreetingService.GreetingServiceClient client) 93 | { 94 | var stream = client.GreetEveryone(); 95 | 96 | var responseReaderTask = Task.Run(async () => 97 | { 98 | while (await stream.ResponseStream.MoveNext()) 99 | Console.WriteLine("Received : " + stream.ResponseStream.Current.Result); 100 | }); 101 | 102 | Greeting[] greetings = 103 | { 104 | new Greeting {FirstName = "John", LastName = "Doe"}, 105 | new Greeting {FirstName = "Clement", LastName = "Jean"}, 106 | new Greeting {FirstName = "Patricia", LastName = "Hertz"} 107 | }; 108 | 109 | foreach (var greeting in greetings) 110 | { 111 | Console.WriteLine("Sending : " + greeting); 112 | await stream.RequestStream.WriteAsync(new GreetEveryoneRequest 113 | { 114 | Greeting = greeting 115 | }); 116 | } 117 | 118 | await stream.RequestStream.CompleteAsync(); 119 | await responseReaderTask; 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("client")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("client")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("b43dea46-171b-4397-b9da-2d16cd029ce2")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /client/client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {B43DEA46-171B-4397-B9DA-2D16CD029CE2} 9 | Exe 10 | client 11 | client 12 | v4.7.2 13 | 512 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | ..\packages\Google.Protobuf.3.10.0\lib\net45\Google.Protobuf.dll 41 | 42 | 43 | ..\packages\Grpc.Core.2.24.0\lib\net45\Grpc.Core.dll 44 | 45 | 46 | ..\packages\Grpc.Core.Api.2.24.0\lib\net45\Grpc.Core.Api.dll 47 | 48 | 49 | 50 | ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll 51 | 52 | 53 | 54 | ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll 55 | 56 | 57 | 58 | ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll 59 | 60 | 61 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | PreserveNewest 82 | 83 | 84 | PreserveNewest 85 | 86 | 87 | PreserveNewest 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /client/models/Dummy.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: dummy.proto 4 | // 5 | #pragma warning disable 1591, 0612, 3021 6 | #region Designer generated code 7 | 8 | using pb = global::Google.Protobuf; 9 | using pbc = global::Google.Protobuf.Collections; 10 | using pbr = global::Google.Protobuf.Reflection; 11 | using scg = global::System.Collections.Generic; 12 | namespace Dummy { 13 | 14 | /// Holder for reflection information generated from dummy.proto 15 | public static partial class DummyReflection { 16 | 17 | #region Descriptor 18 | /// File descriptor for dummy.proto 19 | public static pbr::FileDescriptor Descriptor { 20 | get { return descriptor; } 21 | } 22 | private static pbr::FileDescriptor descriptor; 23 | 24 | static DummyReflection() { 25 | byte[] descriptorData = global::System.Convert.FromBase64String( 26 | string.Concat( 27 | "CgtkdW1teS5wcm90bxIFZHVtbXkiDgoMRHVtbXlNZXNzYWdlMg4KDER1bW15", 28 | "U2VydmljZWIGcHJvdG8z")); 29 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 30 | new pbr::FileDescriptor[] { }, 31 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 32 | new pbr::GeneratedClrTypeInfo(typeof(global::Dummy.DummyMessage), global::Dummy.DummyMessage.Parser, null, null, null, null) 33 | })); 34 | } 35 | #endregion 36 | 37 | } 38 | #region Messages 39 | public sealed partial class DummyMessage : pb::IMessage { 40 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessage()); 41 | private pb::UnknownFieldSet _unknownFields; 42 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 43 | public static pb::MessageParser Parser { get { return _parser; } } 44 | 45 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 46 | public static pbr::MessageDescriptor Descriptor { 47 | get { return global::Dummy.DummyReflection.Descriptor.MessageTypes[0]; } 48 | } 49 | 50 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 51 | pbr::MessageDescriptor pb::IMessage.Descriptor { 52 | get { return Descriptor; } 53 | } 54 | 55 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 56 | public DummyMessage() { 57 | OnConstruction(); 58 | } 59 | 60 | partial void OnConstruction(); 61 | 62 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 63 | public DummyMessage(DummyMessage other) : this() { 64 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 65 | } 66 | 67 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 68 | public DummyMessage Clone() { 69 | return new DummyMessage(this); 70 | } 71 | 72 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 73 | public override bool Equals(object other) { 74 | return Equals(other as DummyMessage); 75 | } 76 | 77 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 78 | public bool Equals(DummyMessage other) { 79 | if (ReferenceEquals(other, null)) { 80 | return false; 81 | } 82 | if (ReferenceEquals(other, this)) { 83 | return true; 84 | } 85 | return Equals(_unknownFields, other._unknownFields); 86 | } 87 | 88 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 89 | public override int GetHashCode() { 90 | int hash = 1; 91 | if (_unknownFields != null) { 92 | hash ^= _unknownFields.GetHashCode(); 93 | } 94 | return hash; 95 | } 96 | 97 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 98 | public override string ToString() { 99 | return pb::JsonFormatter.ToDiagnosticString(this); 100 | } 101 | 102 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 103 | public void WriteTo(pb::CodedOutputStream output) { 104 | if (_unknownFields != null) { 105 | _unknownFields.WriteTo(output); 106 | } 107 | } 108 | 109 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 110 | public int CalculateSize() { 111 | int size = 0; 112 | if (_unknownFields != null) { 113 | size += _unknownFields.CalculateSize(); 114 | } 115 | return size; 116 | } 117 | 118 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 119 | public void MergeFrom(DummyMessage other) { 120 | if (other == null) { 121 | return; 122 | } 123 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 124 | } 125 | 126 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 127 | public void MergeFrom(pb::CodedInputStream input) { 128 | uint tag; 129 | while ((tag = input.ReadTag()) != 0) { 130 | switch(tag) { 131 | default: 132 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 133 | break; 134 | } 135 | } 136 | } 137 | 138 | } 139 | 140 | #endregion 141 | 142 | } 143 | 144 | #endregion Designer generated code 145 | -------------------------------------------------------------------------------- /client/models/DummyGrpc.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: dummy.proto 4 | // 5 | #pragma warning disable 0414, 1591 6 | #region Designer generated code 7 | 8 | using grpc = global::Grpc.Core; 9 | 10 | namespace Dummy { 11 | public static partial class DummyService 12 | { 13 | static readonly string __ServiceName = "dummy.DummyService"; 14 | 15 | 16 | /// Service descriptor 17 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 18 | { 19 | get { return global::Dummy.DummyReflection.Descriptor.Services[0]; } 20 | } 21 | 22 | /// Base class for server-side implementations of DummyService 23 | [grpc::BindServiceMethod(typeof(DummyService), "BindService")] 24 | public abstract partial class DummyServiceBase 25 | { 26 | } 27 | 28 | /// Client for DummyService 29 | public partial class DummyServiceClient : grpc::ClientBase 30 | { 31 | /// Creates a new client for DummyService 32 | /// The channel to use to make remote calls. 33 | public DummyServiceClient(grpc::ChannelBase channel) : base(channel) 34 | { 35 | } 36 | /// Creates a new client for DummyService that uses a custom CallInvoker. 37 | /// The callInvoker to use to make remote calls. 38 | public DummyServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 39 | { 40 | } 41 | /// Protected parameterless constructor to allow creation of test doubles. 42 | protected DummyServiceClient() : base() 43 | { 44 | } 45 | /// Protected constructor to allow creation of configured clients. 46 | /// The client configuration. 47 | protected DummyServiceClient(ClientBaseConfiguration configuration) : base(configuration) 48 | { 49 | } 50 | 51 | /// Creates a new instance of client from given ClientBaseConfiguration. 52 | protected override DummyServiceClient NewInstance(ClientBaseConfiguration configuration) 53 | { 54 | return new DummyServiceClient(configuration); 55 | } 56 | } 57 | 58 | /// Creates service definition that can be registered with a server 59 | /// An object implementing the server-side handling logic. 60 | public static grpc::ServerServiceDefinition BindService(DummyServiceBase serviceImpl) 61 | { 62 | return grpc::ServerServiceDefinition.CreateBuilder().Build(); 63 | } 64 | 65 | /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 66 | /// Note: this method is part of an experimental API that can change or be removed without any prior notice. 67 | /// Service methods will be bound by calling AddMethod on this object. 68 | /// An object implementing the server-side handling logic. 69 | public static void BindService(grpc::ServiceBinderBase serviceBinder, DummyServiceBase serviceImpl) 70 | { 71 | } 72 | 73 | } 74 | } 75 | #endregion 76 | -------------------------------------------------------------------------------- /client/models/Greeting.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: greeting.proto 4 | // 5 | #pragma warning disable 1591, 0612, 3021 6 | #region Designer generated code 7 | 8 | using pb = global::Google.Protobuf; 9 | using pbc = global::Google.Protobuf.Collections; 10 | using pbr = global::Google.Protobuf.Reflection; 11 | using scg = global::System.Collections.Generic; 12 | namespace Greet { 13 | 14 | /// Holder for reflection information generated from greeting.proto 15 | public static partial class GreetingReflection { 16 | 17 | #region Descriptor 18 | /// File descriptor for greeting.proto 19 | public static pbr::FileDescriptor Descriptor { 20 | get { return descriptor; } 21 | } 22 | private static pbr::FileDescriptor descriptor; 23 | 24 | static GreetingReflection() { 25 | byte[] descriptorData = global::System.Convert.FromBase64String( 26 | string.Concat( 27 | "Cg5ncmVldGluZy5wcm90bxIFZ3JlZXQiMQoIR3JlZXRpbmcSEgoKZmlyc3Rf", 28 | "bmFtZRgBIAEoCRIRCglsYXN0X25hbWUYAiABKAkiNAoPR3JlZXRpbmdSZXF1", 29 | "ZXN0EiEKCGdyZWV0aW5nGAEgASgLMg8uZ3JlZXQuR3JlZXRpbmciIgoQR3Jl", 30 | "ZXRpbmdSZXNwb25zZRIOCgZyZXN1bHQYASABKAkiOgoVR3JlZXRNYW55VGlt", 31 | "ZXNSZXF1ZXN0EiEKCGdyZWV0aW5nGAEgASgLMg8uZ3JlZXQuR3JlZXRpbmci", 32 | "KAoWR3JlZXRNYW55VGltZXNSZXNwb25zZRIOCgZyZXN1bHQYASABKAkiNQoQ", 33 | "TG9uZ0dyZWV0UmVxdWVzdBIhCghncmVldGluZxgBIAEoCzIPLmdyZWV0Lkdy", 34 | "ZWV0aW5nIiMKEUxvbmdHcmVldFJlc3BvbnNlEg4KBnJlc3VsdBgBIAEoCSI5", 35 | "ChRHcmVldEV2ZXJ5b25lUmVxdWVzdBIhCghncmVldGluZxgBIAEoCzIPLmdy", 36 | "ZWV0LkdyZWV0aW5nIicKFUdyZWV0RXZlcnlvbmVSZXNwb25zZRIOCgZyZXN1", 37 | "bHQYASABKAkytgIKD0dyZWV0aW5nU2VydmljZRI6CgVHcmVldBIWLmdyZWV0", 38 | "LkdyZWV0aW5nUmVxdWVzdBoXLmdyZWV0LkdyZWV0aW5nUmVzcG9uc2UiABJR", 39 | "Cg5HcmVldE1hbnlUaW1lcxIcLmdyZWV0LkdyZWV0TWFueVRpbWVzUmVxdWVz", 40 | "dBodLmdyZWV0LkdyZWV0TWFueVRpbWVzUmVzcG9uc2UiADABEkIKCUxvbmdH", 41 | "cmVldBIXLmdyZWV0LkxvbmdHcmVldFJlcXVlc3QaGC5ncmVldC5Mb25nR3Jl", 42 | "ZXRSZXNwb25zZSIAKAESUAoNR3JlZXRFdmVyeW9uZRIbLmdyZWV0LkdyZWV0", 43 | "RXZlcnlvbmVSZXF1ZXN0GhwuZ3JlZXQuR3JlZXRFdmVyeW9uZVJlc3BvbnNl", 44 | "IgAoATABYgZwcm90bzM=")); 45 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 46 | new pbr::FileDescriptor[] { }, 47 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 48 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.Greeting), global::Greet.Greeting.Parser, new[]{ "FirstName", "LastName" }, null, null, null), 49 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetingRequest), global::Greet.GreetingRequest.Parser, new[]{ "Greeting" }, null, null, null), 50 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetingResponse), global::Greet.GreetingResponse.Parser, new[]{ "Result" }, null, null, null), 51 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetManyTimesRequest), global::Greet.GreetManyTimesRequest.Parser, new[]{ "Greeting" }, null, null, null), 52 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetManyTimesResponse), global::Greet.GreetManyTimesResponse.Parser, new[]{ "Result" }, null, null, null), 53 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.LongGreetRequest), global::Greet.LongGreetRequest.Parser, new[]{ "Greeting" }, null, null, null), 54 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.LongGreetResponse), global::Greet.LongGreetResponse.Parser, new[]{ "Result" }, null, null, null), 55 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetEveryoneRequest), global::Greet.GreetEveryoneRequest.Parser, new[]{ "Greeting" }, null, null, null), 56 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetEveryoneResponse), global::Greet.GreetEveryoneResponse.Parser, new[]{ "Result" }, null, null, null) 57 | })); 58 | } 59 | #endregion 60 | 61 | } 62 | #region Messages 63 | public sealed partial class Greeting : pb::IMessage { 64 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Greeting()); 65 | private pb::UnknownFieldSet _unknownFields; 66 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 67 | public static pb::MessageParser Parser { get { return _parser; } } 68 | 69 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 70 | public static pbr::MessageDescriptor Descriptor { 71 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[0]; } 72 | } 73 | 74 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 75 | pbr::MessageDescriptor pb::IMessage.Descriptor { 76 | get { return Descriptor; } 77 | } 78 | 79 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 80 | public Greeting() { 81 | OnConstruction(); 82 | } 83 | 84 | partial void OnConstruction(); 85 | 86 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 87 | public Greeting(Greeting other) : this() { 88 | firstName_ = other.firstName_; 89 | lastName_ = other.lastName_; 90 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 91 | } 92 | 93 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 94 | public Greeting Clone() { 95 | return new Greeting(this); 96 | } 97 | 98 | /// Field number for the "first_name" field. 99 | public const int FirstNameFieldNumber = 1; 100 | private string firstName_ = ""; 101 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 102 | public string FirstName { 103 | get { return firstName_; } 104 | set { 105 | firstName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 106 | } 107 | } 108 | 109 | /// Field number for the "last_name" field. 110 | public const int LastNameFieldNumber = 2; 111 | private string lastName_ = ""; 112 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 113 | public string LastName { 114 | get { return lastName_; } 115 | set { 116 | lastName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 117 | } 118 | } 119 | 120 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 121 | public override bool Equals(object other) { 122 | return Equals(other as Greeting); 123 | } 124 | 125 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 126 | public bool Equals(Greeting other) { 127 | if (ReferenceEquals(other, null)) { 128 | return false; 129 | } 130 | if (ReferenceEquals(other, this)) { 131 | return true; 132 | } 133 | if (FirstName != other.FirstName) return false; 134 | if (LastName != other.LastName) return false; 135 | return Equals(_unknownFields, other._unknownFields); 136 | } 137 | 138 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 139 | public override int GetHashCode() { 140 | int hash = 1; 141 | if (FirstName.Length != 0) hash ^= FirstName.GetHashCode(); 142 | if (LastName.Length != 0) hash ^= LastName.GetHashCode(); 143 | if (_unknownFields != null) { 144 | hash ^= _unknownFields.GetHashCode(); 145 | } 146 | return hash; 147 | } 148 | 149 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 150 | public override string ToString() { 151 | return pb::JsonFormatter.ToDiagnosticString(this); 152 | } 153 | 154 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 155 | public void WriteTo(pb::CodedOutputStream output) { 156 | if (FirstName.Length != 0) { 157 | output.WriteRawTag(10); 158 | output.WriteString(FirstName); 159 | } 160 | if (LastName.Length != 0) { 161 | output.WriteRawTag(18); 162 | output.WriteString(LastName); 163 | } 164 | if (_unknownFields != null) { 165 | _unknownFields.WriteTo(output); 166 | } 167 | } 168 | 169 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 170 | public int CalculateSize() { 171 | int size = 0; 172 | if (FirstName.Length != 0) { 173 | size += 1 + pb::CodedOutputStream.ComputeStringSize(FirstName); 174 | } 175 | if (LastName.Length != 0) { 176 | size += 1 + pb::CodedOutputStream.ComputeStringSize(LastName); 177 | } 178 | if (_unknownFields != null) { 179 | size += _unknownFields.CalculateSize(); 180 | } 181 | return size; 182 | } 183 | 184 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 185 | public void MergeFrom(Greeting other) { 186 | if (other == null) { 187 | return; 188 | } 189 | if (other.FirstName.Length != 0) { 190 | FirstName = other.FirstName; 191 | } 192 | if (other.LastName.Length != 0) { 193 | LastName = other.LastName; 194 | } 195 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 196 | } 197 | 198 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 199 | public void MergeFrom(pb::CodedInputStream input) { 200 | uint tag; 201 | while ((tag = input.ReadTag()) != 0) { 202 | switch(tag) { 203 | default: 204 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 205 | break; 206 | case 10: { 207 | FirstName = input.ReadString(); 208 | break; 209 | } 210 | case 18: { 211 | LastName = input.ReadString(); 212 | break; 213 | } 214 | } 215 | } 216 | } 217 | 218 | } 219 | 220 | public sealed partial class GreetingRequest : pb::IMessage { 221 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetingRequest()); 222 | private pb::UnknownFieldSet _unknownFields; 223 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 224 | public static pb::MessageParser Parser { get { return _parser; } } 225 | 226 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 227 | public static pbr::MessageDescriptor Descriptor { 228 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[1]; } 229 | } 230 | 231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 232 | pbr::MessageDescriptor pb::IMessage.Descriptor { 233 | get { return Descriptor; } 234 | } 235 | 236 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 237 | public GreetingRequest() { 238 | OnConstruction(); 239 | } 240 | 241 | partial void OnConstruction(); 242 | 243 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 244 | public GreetingRequest(GreetingRequest other) : this() { 245 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 246 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 247 | } 248 | 249 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 250 | public GreetingRequest Clone() { 251 | return new GreetingRequest(this); 252 | } 253 | 254 | /// Field number for the "greeting" field. 255 | public const int GreetingFieldNumber = 1; 256 | private global::Greet.Greeting greeting_; 257 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 258 | public global::Greet.Greeting Greeting { 259 | get { return greeting_; } 260 | set { 261 | greeting_ = value; 262 | } 263 | } 264 | 265 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 266 | public override bool Equals(object other) { 267 | return Equals(other as GreetingRequest); 268 | } 269 | 270 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 271 | public bool Equals(GreetingRequest other) { 272 | if (ReferenceEquals(other, null)) { 273 | return false; 274 | } 275 | if (ReferenceEquals(other, this)) { 276 | return true; 277 | } 278 | if (!object.Equals(Greeting, other.Greeting)) return false; 279 | return Equals(_unknownFields, other._unknownFields); 280 | } 281 | 282 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 283 | public override int GetHashCode() { 284 | int hash = 1; 285 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 286 | if (_unknownFields != null) { 287 | hash ^= _unknownFields.GetHashCode(); 288 | } 289 | return hash; 290 | } 291 | 292 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 293 | public override string ToString() { 294 | return pb::JsonFormatter.ToDiagnosticString(this); 295 | } 296 | 297 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 298 | public void WriteTo(pb::CodedOutputStream output) { 299 | if (greeting_ != null) { 300 | output.WriteRawTag(10); 301 | output.WriteMessage(Greeting); 302 | } 303 | if (_unknownFields != null) { 304 | _unknownFields.WriteTo(output); 305 | } 306 | } 307 | 308 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 309 | public int CalculateSize() { 310 | int size = 0; 311 | if (greeting_ != null) { 312 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 313 | } 314 | if (_unknownFields != null) { 315 | size += _unknownFields.CalculateSize(); 316 | } 317 | return size; 318 | } 319 | 320 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 321 | public void MergeFrom(GreetingRequest other) { 322 | if (other == null) { 323 | return; 324 | } 325 | if (other.greeting_ != null) { 326 | if (greeting_ == null) { 327 | Greeting = new global::Greet.Greeting(); 328 | } 329 | Greeting.MergeFrom(other.Greeting); 330 | } 331 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 332 | } 333 | 334 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 335 | public void MergeFrom(pb::CodedInputStream input) { 336 | uint tag; 337 | while ((tag = input.ReadTag()) != 0) { 338 | switch(tag) { 339 | default: 340 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 341 | break; 342 | case 10: { 343 | if (greeting_ == null) { 344 | Greeting = new global::Greet.Greeting(); 345 | } 346 | input.ReadMessage(Greeting); 347 | break; 348 | } 349 | } 350 | } 351 | } 352 | 353 | } 354 | 355 | public sealed partial class GreetingResponse : pb::IMessage { 356 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetingResponse()); 357 | private pb::UnknownFieldSet _unknownFields; 358 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 359 | public static pb::MessageParser Parser { get { return _parser; } } 360 | 361 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 362 | public static pbr::MessageDescriptor Descriptor { 363 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[2]; } 364 | } 365 | 366 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 367 | pbr::MessageDescriptor pb::IMessage.Descriptor { 368 | get { return Descriptor; } 369 | } 370 | 371 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 372 | public GreetingResponse() { 373 | OnConstruction(); 374 | } 375 | 376 | partial void OnConstruction(); 377 | 378 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 379 | public GreetingResponse(GreetingResponse other) : this() { 380 | result_ = other.result_; 381 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 382 | } 383 | 384 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 385 | public GreetingResponse Clone() { 386 | return new GreetingResponse(this); 387 | } 388 | 389 | /// Field number for the "result" field. 390 | public const int ResultFieldNumber = 1; 391 | private string result_ = ""; 392 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 393 | public string Result { 394 | get { return result_; } 395 | set { 396 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 397 | } 398 | } 399 | 400 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 401 | public override bool Equals(object other) { 402 | return Equals(other as GreetingResponse); 403 | } 404 | 405 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 406 | public bool Equals(GreetingResponse other) { 407 | if (ReferenceEquals(other, null)) { 408 | return false; 409 | } 410 | if (ReferenceEquals(other, this)) { 411 | return true; 412 | } 413 | if (Result != other.Result) return false; 414 | return Equals(_unknownFields, other._unknownFields); 415 | } 416 | 417 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 418 | public override int GetHashCode() { 419 | int hash = 1; 420 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 421 | if (_unknownFields != null) { 422 | hash ^= _unknownFields.GetHashCode(); 423 | } 424 | return hash; 425 | } 426 | 427 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 428 | public override string ToString() { 429 | return pb::JsonFormatter.ToDiagnosticString(this); 430 | } 431 | 432 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 433 | public void WriteTo(pb::CodedOutputStream output) { 434 | if (Result.Length != 0) { 435 | output.WriteRawTag(10); 436 | output.WriteString(Result); 437 | } 438 | if (_unknownFields != null) { 439 | _unknownFields.WriteTo(output); 440 | } 441 | } 442 | 443 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 444 | public int CalculateSize() { 445 | int size = 0; 446 | if (Result.Length != 0) { 447 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 448 | } 449 | if (_unknownFields != null) { 450 | size += _unknownFields.CalculateSize(); 451 | } 452 | return size; 453 | } 454 | 455 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 456 | public void MergeFrom(GreetingResponse other) { 457 | if (other == null) { 458 | return; 459 | } 460 | if (other.Result.Length != 0) { 461 | Result = other.Result; 462 | } 463 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 464 | } 465 | 466 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 467 | public void MergeFrom(pb::CodedInputStream input) { 468 | uint tag; 469 | while ((tag = input.ReadTag()) != 0) { 470 | switch(tag) { 471 | default: 472 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 473 | break; 474 | case 10: { 475 | Result = input.ReadString(); 476 | break; 477 | } 478 | } 479 | } 480 | } 481 | 482 | } 483 | 484 | public sealed partial class GreetManyTimesRequest : pb::IMessage { 485 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetManyTimesRequest()); 486 | private pb::UnknownFieldSet _unknownFields; 487 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 488 | public static pb::MessageParser Parser { get { return _parser; } } 489 | 490 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 491 | public static pbr::MessageDescriptor Descriptor { 492 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[3]; } 493 | } 494 | 495 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 496 | pbr::MessageDescriptor pb::IMessage.Descriptor { 497 | get { return Descriptor; } 498 | } 499 | 500 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 501 | public GreetManyTimesRequest() { 502 | OnConstruction(); 503 | } 504 | 505 | partial void OnConstruction(); 506 | 507 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 508 | public GreetManyTimesRequest(GreetManyTimesRequest other) : this() { 509 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 510 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 511 | } 512 | 513 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 514 | public GreetManyTimesRequest Clone() { 515 | return new GreetManyTimesRequest(this); 516 | } 517 | 518 | /// Field number for the "greeting" field. 519 | public const int GreetingFieldNumber = 1; 520 | private global::Greet.Greeting greeting_; 521 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 522 | public global::Greet.Greeting Greeting { 523 | get { return greeting_; } 524 | set { 525 | greeting_ = value; 526 | } 527 | } 528 | 529 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 530 | public override bool Equals(object other) { 531 | return Equals(other as GreetManyTimesRequest); 532 | } 533 | 534 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 535 | public bool Equals(GreetManyTimesRequest other) { 536 | if (ReferenceEquals(other, null)) { 537 | return false; 538 | } 539 | if (ReferenceEquals(other, this)) { 540 | return true; 541 | } 542 | if (!object.Equals(Greeting, other.Greeting)) return false; 543 | return Equals(_unknownFields, other._unknownFields); 544 | } 545 | 546 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 547 | public override int GetHashCode() { 548 | int hash = 1; 549 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 550 | if (_unknownFields != null) { 551 | hash ^= _unknownFields.GetHashCode(); 552 | } 553 | return hash; 554 | } 555 | 556 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 557 | public override string ToString() { 558 | return pb::JsonFormatter.ToDiagnosticString(this); 559 | } 560 | 561 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 562 | public void WriteTo(pb::CodedOutputStream output) { 563 | if (greeting_ != null) { 564 | output.WriteRawTag(10); 565 | output.WriteMessage(Greeting); 566 | } 567 | if (_unknownFields != null) { 568 | _unknownFields.WriteTo(output); 569 | } 570 | } 571 | 572 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 573 | public int CalculateSize() { 574 | int size = 0; 575 | if (greeting_ != null) { 576 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 577 | } 578 | if (_unknownFields != null) { 579 | size += _unknownFields.CalculateSize(); 580 | } 581 | return size; 582 | } 583 | 584 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 585 | public void MergeFrom(GreetManyTimesRequest other) { 586 | if (other == null) { 587 | return; 588 | } 589 | if (other.greeting_ != null) { 590 | if (greeting_ == null) { 591 | Greeting = new global::Greet.Greeting(); 592 | } 593 | Greeting.MergeFrom(other.Greeting); 594 | } 595 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 596 | } 597 | 598 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 599 | public void MergeFrom(pb::CodedInputStream input) { 600 | uint tag; 601 | while ((tag = input.ReadTag()) != 0) { 602 | switch(tag) { 603 | default: 604 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 605 | break; 606 | case 10: { 607 | if (greeting_ == null) { 608 | Greeting = new global::Greet.Greeting(); 609 | } 610 | input.ReadMessage(Greeting); 611 | break; 612 | } 613 | } 614 | } 615 | } 616 | 617 | } 618 | 619 | public sealed partial class GreetManyTimesResponse : pb::IMessage { 620 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetManyTimesResponse()); 621 | private pb::UnknownFieldSet _unknownFields; 622 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 623 | public static pb::MessageParser Parser { get { return _parser; } } 624 | 625 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 626 | public static pbr::MessageDescriptor Descriptor { 627 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[4]; } 628 | } 629 | 630 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 631 | pbr::MessageDescriptor pb::IMessage.Descriptor { 632 | get { return Descriptor; } 633 | } 634 | 635 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 636 | public GreetManyTimesResponse() { 637 | OnConstruction(); 638 | } 639 | 640 | partial void OnConstruction(); 641 | 642 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 643 | public GreetManyTimesResponse(GreetManyTimesResponse other) : this() { 644 | result_ = other.result_; 645 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 646 | } 647 | 648 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 649 | public GreetManyTimesResponse Clone() { 650 | return new GreetManyTimesResponse(this); 651 | } 652 | 653 | /// Field number for the "result" field. 654 | public const int ResultFieldNumber = 1; 655 | private string result_ = ""; 656 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 657 | public string Result { 658 | get { return result_; } 659 | set { 660 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 661 | } 662 | } 663 | 664 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 665 | public override bool Equals(object other) { 666 | return Equals(other as GreetManyTimesResponse); 667 | } 668 | 669 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 670 | public bool Equals(GreetManyTimesResponse other) { 671 | if (ReferenceEquals(other, null)) { 672 | return false; 673 | } 674 | if (ReferenceEquals(other, this)) { 675 | return true; 676 | } 677 | if (Result != other.Result) return false; 678 | return Equals(_unknownFields, other._unknownFields); 679 | } 680 | 681 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 682 | public override int GetHashCode() { 683 | int hash = 1; 684 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 685 | if (_unknownFields != null) { 686 | hash ^= _unknownFields.GetHashCode(); 687 | } 688 | return hash; 689 | } 690 | 691 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 692 | public override string ToString() { 693 | return pb::JsonFormatter.ToDiagnosticString(this); 694 | } 695 | 696 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 697 | public void WriteTo(pb::CodedOutputStream output) { 698 | if (Result.Length != 0) { 699 | output.WriteRawTag(10); 700 | output.WriteString(Result); 701 | } 702 | if (_unknownFields != null) { 703 | _unknownFields.WriteTo(output); 704 | } 705 | } 706 | 707 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 708 | public int CalculateSize() { 709 | int size = 0; 710 | if (Result.Length != 0) { 711 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 712 | } 713 | if (_unknownFields != null) { 714 | size += _unknownFields.CalculateSize(); 715 | } 716 | return size; 717 | } 718 | 719 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 720 | public void MergeFrom(GreetManyTimesResponse other) { 721 | if (other == null) { 722 | return; 723 | } 724 | if (other.Result.Length != 0) { 725 | Result = other.Result; 726 | } 727 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 728 | } 729 | 730 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 731 | public void MergeFrom(pb::CodedInputStream input) { 732 | uint tag; 733 | while ((tag = input.ReadTag()) != 0) { 734 | switch(tag) { 735 | default: 736 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 737 | break; 738 | case 10: { 739 | Result = input.ReadString(); 740 | break; 741 | } 742 | } 743 | } 744 | } 745 | 746 | } 747 | 748 | public sealed partial class LongGreetRequest : pb::IMessage { 749 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongGreetRequest()); 750 | private pb::UnknownFieldSet _unknownFields; 751 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 752 | public static pb::MessageParser Parser { get { return _parser; } } 753 | 754 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 755 | public static pbr::MessageDescriptor Descriptor { 756 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[5]; } 757 | } 758 | 759 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 760 | pbr::MessageDescriptor pb::IMessage.Descriptor { 761 | get { return Descriptor; } 762 | } 763 | 764 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 765 | public LongGreetRequest() { 766 | OnConstruction(); 767 | } 768 | 769 | partial void OnConstruction(); 770 | 771 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 772 | public LongGreetRequest(LongGreetRequest other) : this() { 773 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 774 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 775 | } 776 | 777 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 778 | public LongGreetRequest Clone() { 779 | return new LongGreetRequest(this); 780 | } 781 | 782 | /// Field number for the "greeting" field. 783 | public const int GreetingFieldNumber = 1; 784 | private global::Greet.Greeting greeting_; 785 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 786 | public global::Greet.Greeting Greeting { 787 | get { return greeting_; } 788 | set { 789 | greeting_ = value; 790 | } 791 | } 792 | 793 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 794 | public override bool Equals(object other) { 795 | return Equals(other as LongGreetRequest); 796 | } 797 | 798 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 799 | public bool Equals(LongGreetRequest other) { 800 | if (ReferenceEquals(other, null)) { 801 | return false; 802 | } 803 | if (ReferenceEquals(other, this)) { 804 | return true; 805 | } 806 | if (!object.Equals(Greeting, other.Greeting)) return false; 807 | return Equals(_unknownFields, other._unknownFields); 808 | } 809 | 810 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 811 | public override int GetHashCode() { 812 | int hash = 1; 813 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 814 | if (_unknownFields != null) { 815 | hash ^= _unknownFields.GetHashCode(); 816 | } 817 | return hash; 818 | } 819 | 820 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 821 | public override string ToString() { 822 | return pb::JsonFormatter.ToDiagnosticString(this); 823 | } 824 | 825 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 826 | public void WriteTo(pb::CodedOutputStream output) { 827 | if (greeting_ != null) { 828 | output.WriteRawTag(10); 829 | output.WriteMessage(Greeting); 830 | } 831 | if (_unknownFields != null) { 832 | _unknownFields.WriteTo(output); 833 | } 834 | } 835 | 836 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 837 | public int CalculateSize() { 838 | int size = 0; 839 | if (greeting_ != null) { 840 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 841 | } 842 | if (_unknownFields != null) { 843 | size += _unknownFields.CalculateSize(); 844 | } 845 | return size; 846 | } 847 | 848 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 849 | public void MergeFrom(LongGreetRequest other) { 850 | if (other == null) { 851 | return; 852 | } 853 | if (other.greeting_ != null) { 854 | if (greeting_ == null) { 855 | Greeting = new global::Greet.Greeting(); 856 | } 857 | Greeting.MergeFrom(other.Greeting); 858 | } 859 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 860 | } 861 | 862 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 863 | public void MergeFrom(pb::CodedInputStream input) { 864 | uint tag; 865 | while ((tag = input.ReadTag()) != 0) { 866 | switch(tag) { 867 | default: 868 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 869 | break; 870 | case 10: { 871 | if (greeting_ == null) { 872 | Greeting = new global::Greet.Greeting(); 873 | } 874 | input.ReadMessage(Greeting); 875 | break; 876 | } 877 | } 878 | } 879 | } 880 | 881 | } 882 | 883 | public sealed partial class LongGreetResponse : pb::IMessage { 884 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongGreetResponse()); 885 | private pb::UnknownFieldSet _unknownFields; 886 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 887 | public static pb::MessageParser Parser { get { return _parser; } } 888 | 889 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 890 | public static pbr::MessageDescriptor Descriptor { 891 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[6]; } 892 | } 893 | 894 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 895 | pbr::MessageDescriptor pb::IMessage.Descriptor { 896 | get { return Descriptor; } 897 | } 898 | 899 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 900 | public LongGreetResponse() { 901 | OnConstruction(); 902 | } 903 | 904 | partial void OnConstruction(); 905 | 906 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 907 | public LongGreetResponse(LongGreetResponse other) : this() { 908 | result_ = other.result_; 909 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 910 | } 911 | 912 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 913 | public LongGreetResponse Clone() { 914 | return new LongGreetResponse(this); 915 | } 916 | 917 | /// Field number for the "result" field. 918 | public const int ResultFieldNumber = 1; 919 | private string result_ = ""; 920 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 921 | public string Result { 922 | get { return result_; } 923 | set { 924 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 925 | } 926 | } 927 | 928 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 929 | public override bool Equals(object other) { 930 | return Equals(other as LongGreetResponse); 931 | } 932 | 933 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 934 | public bool Equals(LongGreetResponse other) { 935 | if (ReferenceEquals(other, null)) { 936 | return false; 937 | } 938 | if (ReferenceEquals(other, this)) { 939 | return true; 940 | } 941 | if (Result != other.Result) return false; 942 | return Equals(_unknownFields, other._unknownFields); 943 | } 944 | 945 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 946 | public override int GetHashCode() { 947 | int hash = 1; 948 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 949 | if (_unknownFields != null) { 950 | hash ^= _unknownFields.GetHashCode(); 951 | } 952 | return hash; 953 | } 954 | 955 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 956 | public override string ToString() { 957 | return pb::JsonFormatter.ToDiagnosticString(this); 958 | } 959 | 960 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 961 | public void WriteTo(pb::CodedOutputStream output) { 962 | if (Result.Length != 0) { 963 | output.WriteRawTag(10); 964 | output.WriteString(Result); 965 | } 966 | if (_unknownFields != null) { 967 | _unknownFields.WriteTo(output); 968 | } 969 | } 970 | 971 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 972 | public int CalculateSize() { 973 | int size = 0; 974 | if (Result.Length != 0) { 975 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 976 | } 977 | if (_unknownFields != null) { 978 | size += _unknownFields.CalculateSize(); 979 | } 980 | return size; 981 | } 982 | 983 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 984 | public void MergeFrom(LongGreetResponse other) { 985 | if (other == null) { 986 | return; 987 | } 988 | if (other.Result.Length != 0) { 989 | Result = other.Result; 990 | } 991 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 992 | } 993 | 994 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 995 | public void MergeFrom(pb::CodedInputStream input) { 996 | uint tag; 997 | while ((tag = input.ReadTag()) != 0) { 998 | switch(tag) { 999 | default: 1000 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1001 | break; 1002 | case 10: { 1003 | Result = input.ReadString(); 1004 | break; 1005 | } 1006 | } 1007 | } 1008 | } 1009 | 1010 | } 1011 | 1012 | public sealed partial class GreetEveryoneRequest : pb::IMessage { 1013 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetEveryoneRequest()); 1014 | private pb::UnknownFieldSet _unknownFields; 1015 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1016 | public static pb::MessageParser Parser { get { return _parser; } } 1017 | 1018 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1019 | public static pbr::MessageDescriptor Descriptor { 1020 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[7]; } 1021 | } 1022 | 1023 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1024 | pbr::MessageDescriptor pb::IMessage.Descriptor { 1025 | get { return Descriptor; } 1026 | } 1027 | 1028 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1029 | public GreetEveryoneRequest() { 1030 | OnConstruction(); 1031 | } 1032 | 1033 | partial void OnConstruction(); 1034 | 1035 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1036 | public GreetEveryoneRequest(GreetEveryoneRequest other) : this() { 1037 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 1038 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1039 | } 1040 | 1041 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1042 | public GreetEveryoneRequest Clone() { 1043 | return new GreetEveryoneRequest(this); 1044 | } 1045 | 1046 | /// Field number for the "greeting" field. 1047 | public const int GreetingFieldNumber = 1; 1048 | private global::Greet.Greeting greeting_; 1049 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1050 | public global::Greet.Greeting Greeting { 1051 | get { return greeting_; } 1052 | set { 1053 | greeting_ = value; 1054 | } 1055 | } 1056 | 1057 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1058 | public override bool Equals(object other) { 1059 | return Equals(other as GreetEveryoneRequest); 1060 | } 1061 | 1062 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1063 | public bool Equals(GreetEveryoneRequest other) { 1064 | if (ReferenceEquals(other, null)) { 1065 | return false; 1066 | } 1067 | if (ReferenceEquals(other, this)) { 1068 | return true; 1069 | } 1070 | if (!object.Equals(Greeting, other.Greeting)) return false; 1071 | return Equals(_unknownFields, other._unknownFields); 1072 | } 1073 | 1074 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1075 | public override int GetHashCode() { 1076 | int hash = 1; 1077 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 1078 | if (_unknownFields != null) { 1079 | hash ^= _unknownFields.GetHashCode(); 1080 | } 1081 | return hash; 1082 | } 1083 | 1084 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1085 | public override string ToString() { 1086 | return pb::JsonFormatter.ToDiagnosticString(this); 1087 | } 1088 | 1089 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1090 | public void WriteTo(pb::CodedOutputStream output) { 1091 | if (greeting_ != null) { 1092 | output.WriteRawTag(10); 1093 | output.WriteMessage(Greeting); 1094 | } 1095 | if (_unknownFields != null) { 1096 | _unknownFields.WriteTo(output); 1097 | } 1098 | } 1099 | 1100 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1101 | public int CalculateSize() { 1102 | int size = 0; 1103 | if (greeting_ != null) { 1104 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 1105 | } 1106 | if (_unknownFields != null) { 1107 | size += _unknownFields.CalculateSize(); 1108 | } 1109 | return size; 1110 | } 1111 | 1112 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1113 | public void MergeFrom(GreetEveryoneRequest other) { 1114 | if (other == null) { 1115 | return; 1116 | } 1117 | if (other.greeting_ != null) { 1118 | if (greeting_ == null) { 1119 | Greeting = new global::Greet.Greeting(); 1120 | } 1121 | Greeting.MergeFrom(other.Greeting); 1122 | } 1123 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1124 | } 1125 | 1126 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1127 | public void MergeFrom(pb::CodedInputStream input) { 1128 | uint tag; 1129 | while ((tag = input.ReadTag()) != 0) { 1130 | switch(tag) { 1131 | default: 1132 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1133 | break; 1134 | case 10: { 1135 | if (greeting_ == null) { 1136 | Greeting = new global::Greet.Greeting(); 1137 | } 1138 | input.ReadMessage(Greeting); 1139 | break; 1140 | } 1141 | } 1142 | } 1143 | } 1144 | 1145 | } 1146 | 1147 | public sealed partial class GreetEveryoneResponse : pb::IMessage { 1148 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetEveryoneResponse()); 1149 | private pb::UnknownFieldSet _unknownFields; 1150 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1151 | public static pb::MessageParser Parser { get { return _parser; } } 1152 | 1153 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1154 | public static pbr::MessageDescriptor Descriptor { 1155 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[8]; } 1156 | } 1157 | 1158 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1159 | pbr::MessageDescriptor pb::IMessage.Descriptor { 1160 | get { return Descriptor; } 1161 | } 1162 | 1163 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1164 | public GreetEveryoneResponse() { 1165 | OnConstruction(); 1166 | } 1167 | 1168 | partial void OnConstruction(); 1169 | 1170 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1171 | public GreetEveryoneResponse(GreetEveryoneResponse other) : this() { 1172 | result_ = other.result_; 1173 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1174 | } 1175 | 1176 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1177 | public GreetEveryoneResponse Clone() { 1178 | return new GreetEveryoneResponse(this); 1179 | } 1180 | 1181 | /// Field number for the "result" field. 1182 | public const int ResultFieldNumber = 1; 1183 | private string result_ = ""; 1184 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1185 | public string Result { 1186 | get { return result_; } 1187 | set { 1188 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1189 | } 1190 | } 1191 | 1192 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1193 | public override bool Equals(object other) { 1194 | return Equals(other as GreetEveryoneResponse); 1195 | } 1196 | 1197 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1198 | public bool Equals(GreetEveryoneResponse other) { 1199 | if (ReferenceEquals(other, null)) { 1200 | return false; 1201 | } 1202 | if (ReferenceEquals(other, this)) { 1203 | return true; 1204 | } 1205 | if (Result != other.Result) return false; 1206 | return Equals(_unknownFields, other._unknownFields); 1207 | } 1208 | 1209 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1210 | public override int GetHashCode() { 1211 | int hash = 1; 1212 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 1213 | if (_unknownFields != null) { 1214 | hash ^= _unknownFields.GetHashCode(); 1215 | } 1216 | return hash; 1217 | } 1218 | 1219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1220 | public override string ToString() { 1221 | return pb::JsonFormatter.ToDiagnosticString(this); 1222 | } 1223 | 1224 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1225 | public void WriteTo(pb::CodedOutputStream output) { 1226 | if (Result.Length != 0) { 1227 | output.WriteRawTag(10); 1228 | output.WriteString(Result); 1229 | } 1230 | if (_unknownFields != null) { 1231 | _unknownFields.WriteTo(output); 1232 | } 1233 | } 1234 | 1235 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1236 | public int CalculateSize() { 1237 | int size = 0; 1238 | if (Result.Length != 0) { 1239 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 1240 | } 1241 | if (_unknownFields != null) { 1242 | size += _unknownFields.CalculateSize(); 1243 | } 1244 | return size; 1245 | } 1246 | 1247 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1248 | public void MergeFrom(GreetEveryoneResponse other) { 1249 | if (other == null) { 1250 | return; 1251 | } 1252 | if (other.Result.Length != 0) { 1253 | Result = other.Result; 1254 | } 1255 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1256 | } 1257 | 1258 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1259 | public void MergeFrom(pb::CodedInputStream input) { 1260 | uint tag; 1261 | while ((tag = input.ReadTag()) != 0) { 1262 | switch(tag) { 1263 | default: 1264 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1265 | break; 1266 | case 10: { 1267 | Result = input.ReadString(); 1268 | break; 1269 | } 1270 | } 1271 | } 1272 | } 1273 | 1274 | } 1275 | 1276 | #endregion 1277 | 1278 | } 1279 | 1280 | #endregion Designer generated code 1281 | -------------------------------------------------------------------------------- /client/models/GreetingGrpc.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: greeting.proto 4 | // 5 | #pragma warning disable 0414, 1591 6 | #region Designer generated code 7 | 8 | using grpc = global::Grpc.Core; 9 | 10 | namespace Greet { 11 | public static partial class GreetingService 12 | { 13 | static readonly string __ServiceName = "greet.GreetingService"; 14 | 15 | static readonly grpc::Marshaller __Marshaller_greet_GreetingRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetingRequest.Parser.ParseFrom); 16 | static readonly grpc::Marshaller __Marshaller_greet_GreetingResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetingResponse.Parser.ParseFrom); 17 | static readonly grpc::Marshaller __Marshaller_greet_GreetManyTimesRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetManyTimesRequest.Parser.ParseFrom); 18 | static readonly grpc::Marshaller __Marshaller_greet_GreetManyTimesResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetManyTimesResponse.Parser.ParseFrom); 19 | static readonly grpc::Marshaller __Marshaller_greet_LongGreetRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.LongGreetRequest.Parser.ParseFrom); 20 | static readonly grpc::Marshaller __Marshaller_greet_LongGreetResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.LongGreetResponse.Parser.ParseFrom); 21 | static readonly grpc::Marshaller __Marshaller_greet_GreetEveryoneRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetEveryoneRequest.Parser.ParseFrom); 22 | static readonly grpc::Marshaller __Marshaller_greet_GreetEveryoneResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetEveryoneResponse.Parser.ParseFrom); 23 | 24 | static readonly grpc::Method __Method_Greet = new grpc::Method( 25 | grpc::MethodType.Unary, 26 | __ServiceName, 27 | "Greet", 28 | __Marshaller_greet_GreetingRequest, 29 | __Marshaller_greet_GreetingResponse); 30 | 31 | static readonly grpc::Method __Method_GreetManyTimes = new grpc::Method( 32 | grpc::MethodType.ServerStreaming, 33 | __ServiceName, 34 | "GreetManyTimes", 35 | __Marshaller_greet_GreetManyTimesRequest, 36 | __Marshaller_greet_GreetManyTimesResponse); 37 | 38 | static readonly grpc::Method __Method_LongGreet = new grpc::Method( 39 | grpc::MethodType.ClientStreaming, 40 | __ServiceName, 41 | "LongGreet", 42 | __Marshaller_greet_LongGreetRequest, 43 | __Marshaller_greet_LongGreetResponse); 44 | 45 | static readonly grpc::Method __Method_GreetEveryone = new grpc::Method( 46 | grpc::MethodType.DuplexStreaming, 47 | __ServiceName, 48 | "GreetEveryone", 49 | __Marshaller_greet_GreetEveryoneRequest, 50 | __Marshaller_greet_GreetEveryoneResponse); 51 | 52 | /// Service descriptor 53 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 54 | { 55 | get { return global::Greet.GreetingReflection.Descriptor.Services[0]; } 56 | } 57 | 58 | /// Base class for server-side implementations of GreetingService 59 | [grpc::BindServiceMethod(typeof(GreetingService), "BindService")] 60 | public abstract partial class GreetingServiceBase 61 | { 62 | /// 63 | /// Unary 64 | /// 65 | /// The request received from the client. 66 | /// The context of the server-side call handler being invoked. 67 | /// The response to send back to the client (wrapped by a task). 68 | public virtual global::System.Threading.Tasks.Task Greet(global::Greet.GreetingRequest request, grpc::ServerCallContext context) 69 | { 70 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 71 | } 72 | 73 | /// 74 | /// Server streaming 75 | /// 76 | /// The request received from the client. 77 | /// Used for sending responses back to the client. 78 | /// The context of the server-side call handler being invoked. 79 | /// A task indicating completion of the handler. 80 | public virtual global::System.Threading.Tasks.Task GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) 81 | { 82 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 83 | } 84 | 85 | /// 86 | /// Client streaming 87 | /// 88 | /// Used for reading requests from the client. 89 | /// The context of the server-side call handler being invoked. 90 | /// The response to send back to the client (wrapped by a task). 91 | public virtual global::System.Threading.Tasks.Task LongGreet(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) 92 | { 93 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 94 | } 95 | 96 | /// 97 | /// Bidi streaming 98 | /// 99 | /// Used for reading requests from the client. 100 | /// Used for sending responses back to the client. 101 | /// The context of the server-side call handler being invoked. 102 | /// A task indicating completion of the handler. 103 | public virtual global::System.Threading.Tasks.Task GreetEveryone(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) 104 | { 105 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 106 | } 107 | 108 | } 109 | 110 | /// Client for GreetingService 111 | public partial class GreetingServiceClient : grpc::ClientBase 112 | { 113 | /// Creates a new client for GreetingService 114 | /// The channel to use to make remote calls. 115 | public GreetingServiceClient(grpc::ChannelBase channel) : base(channel) 116 | { 117 | } 118 | /// Creates a new client for GreetingService that uses a custom CallInvoker. 119 | /// The callInvoker to use to make remote calls. 120 | public GreetingServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 121 | { 122 | } 123 | /// Protected parameterless constructor to allow creation of test doubles. 124 | protected GreetingServiceClient() : base() 125 | { 126 | } 127 | /// Protected constructor to allow creation of configured clients. 128 | /// The client configuration. 129 | protected GreetingServiceClient(ClientBaseConfiguration configuration) : base(configuration) 130 | { 131 | } 132 | 133 | /// 134 | /// Unary 135 | /// 136 | /// The request to send to the server. 137 | /// The initial metadata to send with the call. This parameter is optional. 138 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 139 | /// An optional token for canceling the call. 140 | /// The response received from the server. 141 | public virtual global::Greet.GreetingResponse Greet(global::Greet.GreetingRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 142 | { 143 | return Greet(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 144 | } 145 | /// 146 | /// Unary 147 | /// 148 | /// The request to send to the server. 149 | /// The options for the call. 150 | /// The response received from the server. 151 | public virtual global::Greet.GreetingResponse Greet(global::Greet.GreetingRequest request, grpc::CallOptions options) 152 | { 153 | return CallInvoker.BlockingUnaryCall(__Method_Greet, null, options, request); 154 | } 155 | /// 156 | /// Unary 157 | /// 158 | /// The request to send to the server. 159 | /// The initial metadata to send with the call. This parameter is optional. 160 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 161 | /// An optional token for canceling the call. 162 | /// The call object. 163 | public virtual grpc::AsyncUnaryCall GreetAsync(global::Greet.GreetingRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 164 | { 165 | return GreetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 166 | } 167 | /// 168 | /// Unary 169 | /// 170 | /// The request to send to the server. 171 | /// The options for the call. 172 | /// The call object. 173 | public virtual grpc::AsyncUnaryCall GreetAsync(global::Greet.GreetingRequest request, grpc::CallOptions options) 174 | { 175 | return CallInvoker.AsyncUnaryCall(__Method_Greet, null, options, request); 176 | } 177 | /// 178 | /// Server streaming 179 | /// 180 | /// The request to send to the server. 181 | /// The initial metadata to send with the call. This parameter is optional. 182 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 183 | /// An optional token for canceling the call. 184 | /// The call object. 185 | public virtual grpc::AsyncServerStreamingCall GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 186 | { 187 | return GreetManyTimes(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 188 | } 189 | /// 190 | /// Server streaming 191 | /// 192 | /// The request to send to the server. 193 | /// The options for the call. 194 | /// The call object. 195 | public virtual grpc::AsyncServerStreamingCall GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::CallOptions options) 196 | { 197 | return CallInvoker.AsyncServerStreamingCall(__Method_GreetManyTimes, null, options, request); 198 | } 199 | /// 200 | /// Client streaming 201 | /// 202 | /// The initial metadata to send with the call. This parameter is optional. 203 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 204 | /// An optional token for canceling the call. 205 | /// The call object. 206 | public virtual grpc::AsyncClientStreamingCall LongGreet(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 207 | { 208 | return LongGreet(new grpc::CallOptions(headers, deadline, cancellationToken)); 209 | } 210 | /// 211 | /// Client streaming 212 | /// 213 | /// The options for the call. 214 | /// The call object. 215 | public virtual grpc::AsyncClientStreamingCall LongGreet(grpc::CallOptions options) 216 | { 217 | return CallInvoker.AsyncClientStreamingCall(__Method_LongGreet, null, options); 218 | } 219 | /// 220 | /// Bidi streaming 221 | /// 222 | /// The initial metadata to send with the call. This parameter is optional. 223 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 224 | /// An optional token for canceling the call. 225 | /// The call object. 226 | public virtual grpc::AsyncDuplexStreamingCall GreetEveryone(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 227 | { 228 | return GreetEveryone(new grpc::CallOptions(headers, deadline, cancellationToken)); 229 | } 230 | /// 231 | /// Bidi streaming 232 | /// 233 | /// The options for the call. 234 | /// The call object. 235 | public virtual grpc::AsyncDuplexStreamingCall GreetEveryone(grpc::CallOptions options) 236 | { 237 | return CallInvoker.AsyncDuplexStreamingCall(__Method_GreetEveryone, null, options); 238 | } 239 | /// Creates a new instance of client from given ClientBaseConfiguration. 240 | protected override GreetingServiceClient NewInstance(ClientBaseConfiguration configuration) 241 | { 242 | return new GreetingServiceClient(configuration); 243 | } 244 | } 245 | 246 | /// Creates service definition that can be registered with a server 247 | /// An object implementing the server-side handling logic. 248 | public static grpc::ServerServiceDefinition BindService(GreetingServiceBase serviceImpl) 249 | { 250 | return grpc::ServerServiceDefinition.CreateBuilder() 251 | .AddMethod(__Method_Greet, serviceImpl.Greet) 252 | .AddMethod(__Method_GreetManyTimes, serviceImpl.GreetManyTimes) 253 | .AddMethod(__Method_LongGreet, serviceImpl.LongGreet) 254 | .AddMethod(__Method_GreetEveryone, serviceImpl.GreetEveryone).Build(); 255 | } 256 | 257 | /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 258 | /// Note: this method is part of an experimental API that can change or be removed without any prior notice. 259 | /// Service methods will be bound by calling AddMethod on this object. 260 | /// An object implementing the server-side handling logic. 261 | public static void BindService(grpc::ServiceBinderBase serviceBinder, GreetingServiceBase serviceImpl) 262 | { 263 | serviceBinder.AddMethod(__Method_Greet, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Greet)); 264 | serviceBinder.AddMethod(__Method_GreetManyTimes, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.GreetManyTimes)); 265 | serviceBinder.AddMethod(__Method_LongGreet, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod(serviceImpl.LongGreet)); 266 | serviceBinder.AddMethod(__Method_GreetEveryone, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.GreetEveryone)); 267 | } 268 | 269 | } 270 | } 271 | #endregion 272 | -------------------------------------------------------------------------------- /client/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dummy.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package dummy; 4 | 5 | message DummyMessage {} 6 | 7 | service DummyService {} -------------------------------------------------------------------------------- /greeting.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package greet; 4 | 5 | message Greeting { 6 | string first_name = 1; 7 | string last_name = 2; 8 | } 9 | 10 | message GreetingRequest { 11 | Greeting greeting = 1; 12 | } 13 | 14 | message GreetingResponse { 15 | string result = 1; 16 | } 17 | 18 | message GreetManyTimesRequest { 19 | Greeting greeting = 1; 20 | } 21 | 22 | message GreetManyTimesResponse { 23 | string result = 1; 24 | } 25 | 26 | message LongGreetRequest { 27 | Greeting greeting = 1; 28 | } 29 | 30 | message LongGreetResponse { 31 | string result = 1; 32 | } 33 | 34 | message GreetEveryoneRequest { 35 | Greeting greeting = 1; 36 | } 37 | 38 | message GreetEveryoneResponse { 39 | string result = 1; 40 | } 41 | 42 | service GreetingService { 43 | // Unary 44 | rpc Greet (GreetingRequest) returns (GreetingResponse) {} 45 | 46 | // Server streaming 47 | rpc GreetManyTimes (GreetManyTimesRequest) returns (stream GreetManyTimesResponse) {} 48 | 49 | // Client streaming 50 | rpc LongGreet (stream LongGreetRequest) returns (LongGreetResponse) {} 51 | 52 | // Bidi streaming 53 | rpc GreetEveryone (stream GreetEveryoneRequest) returns (stream GreetEveryoneResponse) {} 54 | } -------------------------------------------------------------------------------- /grpc-csharp-class.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29403.142 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{337DFA0B-4476-4932-8139-DBEC67097CA7}" 7 | ProjectSection(SolutionItems) = preProject 8 | dummy.proto = dummy.proto 9 | greeting.proto = greeting.proto 10 | EndProjectSection 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "client\client.csproj", "{B43DEA46-171B-4397-B9DA-2D16CD029CE2}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server", "server\server.csproj", "{F101CBD9-E27E-4D1B-9A20-6B2E404714C8}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6CE96E76-1491-46E0-B60B-1B6F9A99AC09}" 17 | ProjectSection(SolutionItems) = preProject 18 | ssl\ssl.sh = ssl\ssl.sh 19 | EndProjectSection 20 | EndProject 21 | Global 22 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 23 | Debug|Any CPU = Debug|Any CPU 24 | Release|Any CPU = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {B43DEA46-171B-4397-B9DA-2D16CD029CE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 28 | {B43DEA46-171B-4397-B9DA-2D16CD029CE2}.Debug|Any CPU.Build.0 = Debug|Any CPU 29 | {B43DEA46-171B-4397-B9DA-2D16CD029CE2}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {B43DEA46-171B-4397-B9DA-2D16CD029CE2}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {F101CBD9-E27E-4D1B-9A20-6B2E404714C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 32 | {F101CBD9-E27E-4D1B-9A20-6B2E404714C8}.Debug|Any CPU.Build.0 = Debug|Any CPU 33 | {F101CBD9-E27E-4D1B-9A20-6B2E404714C8}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {F101CBD9-E27E-4D1B-9A20-6B2E404714C8}.Release|Any CPU.Build.0 = Release|Any CPU 35 | EndGlobalSection 36 | GlobalSection(SolutionProperties) = preSolution 37 | HideSolutionNode = FALSE 38 | EndGlobalSection 39 | GlobalSection(ExtensibilityGlobals) = postSolution 40 | SolutionGuid = {87000557-7F49-4854-8E6F-3AD4FCBB142E} 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /server/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /server/GreetingServiceImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Greet; 5 | using Grpc.Core; 6 | using static Greet.GreetingService; 7 | 8 | namespace server 9 | { 10 | public class GreetingServiceImpl : GreetingServiceBase 11 | { 12 | public override Task Greet(GreetingRequest request, ServerCallContext context) 13 | { 14 | string result = string.Format("hello {0} {1}", request.Greeting.FirstName, request.Greeting.LastName); 15 | 16 | return Task.FromResult(new GreetingResponse {Result = result}); 17 | } 18 | 19 | public override async Task GreetManyTimes(GreetManyTimesRequest request, 20 | IServerStreamWriter responseStream, ServerCallContext context) 21 | { 22 | Console.WriteLine("The server received the request : "); 23 | Console.WriteLine(request.ToString()); 24 | 25 | string result = string.Format("hello {0} {1}", request.Greeting.FirstName, request.Greeting.LastName); 26 | 27 | foreach (int i in Enumerable.Range(1, 10)) 28 | await responseStream.WriteAsync(new GreetManyTimesResponse {Result = result}); 29 | } 30 | 31 | public override async Task LongGreet(IAsyncStreamReader requestStream, 32 | ServerCallContext context) 33 | { 34 | var result = ""; 35 | 36 | while (await requestStream.MoveNext()) 37 | result += string.Format("Hello {0} {1} {2}", 38 | requestStream.Current.Greeting.FirstName, 39 | requestStream.Current.Greeting.LastName, 40 | Environment.NewLine); 41 | 42 | return new LongGreetResponse {Result = result}; 43 | } 44 | 45 | public override async Task GreetEveryone(IAsyncStreamReader requestStream, 46 | IServerStreamWriter responseStream, ServerCallContext context) 47 | { 48 | while (await requestStream.MoveNext()) 49 | { 50 | string result = string.Format("Hello {0} {1}", 51 | requestStream.Current.Greeting.FirstName, 52 | requestStream.Current.Greeting.LastName); 53 | 54 | Console.WriteLine("Sending : " + result); 55 | await responseStream.WriteAsync(new GreetEveryoneResponse {Result = result}); 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /server/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Greet; 4 | using Grpc.Core; 5 | using Grpc.Reflection; 6 | using Grpc.Reflection.V1Alpha; 7 | 8 | namespace server 9 | { 10 | internal class Program 11 | { 12 | private const int Port = 50051; 13 | 14 | private static void Main(string[] args) 15 | { 16 | Server server = null; 17 | 18 | try 19 | { 20 | //var serverCert = File.ReadAllText("ssl/server.crt"); 21 | //var serverKey = File.ReadAllText("ssl/server.key"); 22 | //var keypair = new KeyCertificatePair(serverCert, serverKey); 23 | //var cacert = File.ReadAllText("ssl/ca.crt"); 24 | 25 | //var credentials = new SslServerCredentials(new List() { keypair }, cacert, true); 26 | 27 | var reflectionServiceImpl = 28 | new ReflectionServiceImpl(GreetingService.Descriptor, ServerReflection.Descriptor); 29 | 30 | server = new Server 31 | { 32 | Services = 33 | { 34 | GreetingService.BindService(new GreetingServiceImpl()), 35 | ServerReflection.BindService(reflectionServiceImpl) 36 | }, 37 | Ports = {new ServerPort("localhost", Port, ServerCredentials.Insecure)} // credentials) } 38 | }; 39 | 40 | server.Start(); 41 | Console.WriteLine("The server is listening on the port : " + Port); 42 | Console.ReadKey(); 43 | } 44 | catch (IOException e) 45 | { 46 | Console.WriteLine("The server failed to start : " + e.Message); 47 | throw; 48 | } 49 | finally 50 | { 51 | if (server != null) 52 | server.ShutdownAsync().Wait(); 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /server/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("server")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("server")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f101cbd9-e27e-4d1b-9a20-6b2e404714c8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /server/models/Dummy.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: dummy.proto 4 | // 5 | #pragma warning disable 1591, 0612, 3021 6 | #region Designer generated code 7 | 8 | using pb = global::Google.Protobuf; 9 | using pbc = global::Google.Protobuf.Collections; 10 | using pbr = global::Google.Protobuf.Reflection; 11 | using scg = global::System.Collections.Generic; 12 | namespace Dummy { 13 | 14 | /// Holder for reflection information generated from dummy.proto 15 | public static partial class DummyReflection { 16 | 17 | #region Descriptor 18 | /// File descriptor for dummy.proto 19 | public static pbr::FileDescriptor Descriptor { 20 | get { return descriptor; } 21 | } 22 | private static pbr::FileDescriptor descriptor; 23 | 24 | static DummyReflection() { 25 | byte[] descriptorData = global::System.Convert.FromBase64String( 26 | string.Concat( 27 | "CgtkdW1teS5wcm90bxIFZHVtbXkiDgoMRHVtbXlNZXNzYWdlMg4KDER1bW15", 28 | "U2VydmljZWIGcHJvdG8z")); 29 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 30 | new pbr::FileDescriptor[] { }, 31 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 32 | new pbr::GeneratedClrTypeInfo(typeof(global::Dummy.DummyMessage), global::Dummy.DummyMessage.Parser, null, null, null, null) 33 | })); 34 | } 35 | #endregion 36 | 37 | } 38 | #region Messages 39 | public sealed partial class DummyMessage : pb::IMessage { 40 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessage()); 41 | private pb::UnknownFieldSet _unknownFields; 42 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 43 | public static pb::MessageParser Parser { get { return _parser; } } 44 | 45 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 46 | public static pbr::MessageDescriptor Descriptor { 47 | get { return global::Dummy.DummyReflection.Descriptor.MessageTypes[0]; } 48 | } 49 | 50 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 51 | pbr::MessageDescriptor pb::IMessage.Descriptor { 52 | get { return Descriptor; } 53 | } 54 | 55 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 56 | public DummyMessage() { 57 | OnConstruction(); 58 | } 59 | 60 | partial void OnConstruction(); 61 | 62 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 63 | public DummyMessage(DummyMessage other) : this() { 64 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 65 | } 66 | 67 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 68 | public DummyMessage Clone() { 69 | return new DummyMessage(this); 70 | } 71 | 72 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 73 | public override bool Equals(object other) { 74 | return Equals(other as DummyMessage); 75 | } 76 | 77 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 78 | public bool Equals(DummyMessage other) { 79 | if (ReferenceEquals(other, null)) { 80 | return false; 81 | } 82 | if (ReferenceEquals(other, this)) { 83 | return true; 84 | } 85 | return Equals(_unknownFields, other._unknownFields); 86 | } 87 | 88 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 89 | public override int GetHashCode() { 90 | int hash = 1; 91 | if (_unknownFields != null) { 92 | hash ^= _unknownFields.GetHashCode(); 93 | } 94 | return hash; 95 | } 96 | 97 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 98 | public override string ToString() { 99 | return pb::JsonFormatter.ToDiagnosticString(this); 100 | } 101 | 102 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 103 | public void WriteTo(pb::CodedOutputStream output) { 104 | if (_unknownFields != null) { 105 | _unknownFields.WriteTo(output); 106 | } 107 | } 108 | 109 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 110 | public int CalculateSize() { 111 | int size = 0; 112 | if (_unknownFields != null) { 113 | size += _unknownFields.CalculateSize(); 114 | } 115 | return size; 116 | } 117 | 118 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 119 | public void MergeFrom(DummyMessage other) { 120 | if (other == null) { 121 | return; 122 | } 123 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 124 | } 125 | 126 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 127 | public void MergeFrom(pb::CodedInputStream input) { 128 | uint tag; 129 | while ((tag = input.ReadTag()) != 0) { 130 | switch(tag) { 131 | default: 132 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 133 | break; 134 | } 135 | } 136 | } 137 | 138 | } 139 | 140 | #endregion 141 | 142 | } 143 | 144 | #endregion Designer generated code 145 | -------------------------------------------------------------------------------- /server/models/DummyGrpc.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: dummy.proto 4 | // 5 | #pragma warning disable 0414, 1591 6 | #region Designer generated code 7 | 8 | using grpc = global::Grpc.Core; 9 | 10 | namespace Dummy { 11 | public static partial class DummyService 12 | { 13 | static readonly string __ServiceName = "dummy.DummyService"; 14 | 15 | 16 | /// Service descriptor 17 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 18 | { 19 | get { return global::Dummy.DummyReflection.Descriptor.Services[0]; } 20 | } 21 | 22 | /// Base class for server-side implementations of DummyService 23 | [grpc::BindServiceMethod(typeof(DummyService), "BindService")] 24 | public abstract partial class DummyServiceBase 25 | { 26 | } 27 | 28 | /// Client for DummyService 29 | public partial class DummyServiceClient : grpc::ClientBase 30 | { 31 | /// Creates a new client for DummyService 32 | /// The channel to use to make remote calls. 33 | public DummyServiceClient(grpc::ChannelBase channel) : base(channel) 34 | { 35 | } 36 | /// Creates a new client for DummyService that uses a custom CallInvoker. 37 | /// The callInvoker to use to make remote calls. 38 | public DummyServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 39 | { 40 | } 41 | /// Protected parameterless constructor to allow creation of test doubles. 42 | protected DummyServiceClient() : base() 43 | { 44 | } 45 | /// Protected constructor to allow creation of configured clients. 46 | /// The client configuration. 47 | protected DummyServiceClient(ClientBaseConfiguration configuration) : base(configuration) 48 | { 49 | } 50 | 51 | /// Creates a new instance of client from given ClientBaseConfiguration. 52 | protected override DummyServiceClient NewInstance(ClientBaseConfiguration configuration) 53 | { 54 | return new DummyServiceClient(configuration); 55 | } 56 | } 57 | 58 | /// Creates service definition that can be registered with a server 59 | /// An object implementing the server-side handling logic. 60 | public static grpc::ServerServiceDefinition BindService(DummyServiceBase serviceImpl) 61 | { 62 | return grpc::ServerServiceDefinition.CreateBuilder().Build(); 63 | } 64 | 65 | /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 66 | /// Note: this method is part of an experimental API that can change or be removed without any prior notice. 67 | /// Service methods will be bound by calling AddMethod on this object. 68 | /// An object implementing the server-side handling logic. 69 | public static void BindService(grpc::ServiceBinderBase serviceBinder, DummyServiceBase serviceImpl) 70 | { 71 | } 72 | 73 | } 74 | } 75 | #endregion 76 | -------------------------------------------------------------------------------- /server/models/Greeting.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: greeting.proto 4 | // 5 | #pragma warning disable 1591, 0612, 3021 6 | #region Designer generated code 7 | 8 | using pb = global::Google.Protobuf; 9 | using pbc = global::Google.Protobuf.Collections; 10 | using pbr = global::Google.Protobuf.Reflection; 11 | using scg = global::System.Collections.Generic; 12 | namespace Greet { 13 | 14 | /// Holder for reflection information generated from greeting.proto 15 | public static partial class GreetingReflection { 16 | 17 | #region Descriptor 18 | /// File descriptor for greeting.proto 19 | public static pbr::FileDescriptor Descriptor { 20 | get { return descriptor; } 21 | } 22 | private static pbr::FileDescriptor descriptor; 23 | 24 | static GreetingReflection() { 25 | byte[] descriptorData = global::System.Convert.FromBase64String( 26 | string.Concat( 27 | "Cg5ncmVldGluZy5wcm90bxIFZ3JlZXQiMQoIR3JlZXRpbmcSEgoKZmlyc3Rf", 28 | "bmFtZRgBIAEoCRIRCglsYXN0X25hbWUYAiABKAkiNAoPR3JlZXRpbmdSZXF1", 29 | "ZXN0EiEKCGdyZWV0aW5nGAEgASgLMg8uZ3JlZXQuR3JlZXRpbmciIgoQR3Jl", 30 | "ZXRpbmdSZXNwb25zZRIOCgZyZXN1bHQYASABKAkiOgoVR3JlZXRNYW55VGlt", 31 | "ZXNSZXF1ZXN0EiEKCGdyZWV0aW5nGAEgASgLMg8uZ3JlZXQuR3JlZXRpbmci", 32 | "KAoWR3JlZXRNYW55VGltZXNSZXNwb25zZRIOCgZyZXN1bHQYASABKAkiNQoQ", 33 | "TG9uZ0dyZWV0UmVxdWVzdBIhCghncmVldGluZxgBIAEoCzIPLmdyZWV0Lkdy", 34 | "ZWV0aW5nIiMKEUxvbmdHcmVldFJlc3BvbnNlEg4KBnJlc3VsdBgBIAEoCSI5", 35 | "ChRHcmVldEV2ZXJ5b25lUmVxdWVzdBIhCghncmVldGluZxgBIAEoCzIPLmdy", 36 | "ZWV0LkdyZWV0aW5nIicKFUdyZWV0RXZlcnlvbmVSZXNwb25zZRIOCgZyZXN1", 37 | "bHQYASABKAkytgIKD0dyZWV0aW5nU2VydmljZRI6CgVHcmVldBIWLmdyZWV0", 38 | "LkdyZWV0aW5nUmVxdWVzdBoXLmdyZWV0LkdyZWV0aW5nUmVzcG9uc2UiABJR", 39 | "Cg5HcmVldE1hbnlUaW1lcxIcLmdyZWV0LkdyZWV0TWFueVRpbWVzUmVxdWVz", 40 | "dBodLmdyZWV0LkdyZWV0TWFueVRpbWVzUmVzcG9uc2UiADABEkIKCUxvbmdH", 41 | "cmVldBIXLmdyZWV0LkxvbmdHcmVldFJlcXVlc3QaGC5ncmVldC5Mb25nR3Jl", 42 | "ZXRSZXNwb25zZSIAKAESUAoNR3JlZXRFdmVyeW9uZRIbLmdyZWV0LkdyZWV0", 43 | "RXZlcnlvbmVSZXF1ZXN0GhwuZ3JlZXQuR3JlZXRFdmVyeW9uZVJlc3BvbnNl", 44 | "IgAoATABYgZwcm90bzM=")); 45 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 46 | new pbr::FileDescriptor[] { }, 47 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 48 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.Greeting), global::Greet.Greeting.Parser, new[]{ "FirstName", "LastName" }, null, null, null), 49 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetingRequest), global::Greet.GreetingRequest.Parser, new[]{ "Greeting" }, null, null, null), 50 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetingResponse), global::Greet.GreetingResponse.Parser, new[]{ "Result" }, null, null, null), 51 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetManyTimesRequest), global::Greet.GreetManyTimesRequest.Parser, new[]{ "Greeting" }, null, null, null), 52 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetManyTimesResponse), global::Greet.GreetManyTimesResponse.Parser, new[]{ "Result" }, null, null, null), 53 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.LongGreetRequest), global::Greet.LongGreetRequest.Parser, new[]{ "Greeting" }, null, null, null), 54 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.LongGreetResponse), global::Greet.LongGreetResponse.Parser, new[]{ "Result" }, null, null, null), 55 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetEveryoneRequest), global::Greet.GreetEveryoneRequest.Parser, new[]{ "Greeting" }, null, null, null), 56 | new pbr::GeneratedClrTypeInfo(typeof(global::Greet.GreetEveryoneResponse), global::Greet.GreetEveryoneResponse.Parser, new[]{ "Result" }, null, null, null) 57 | })); 58 | } 59 | #endregion 60 | 61 | } 62 | #region Messages 63 | public sealed partial class Greeting : pb::IMessage { 64 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Greeting()); 65 | private pb::UnknownFieldSet _unknownFields; 66 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 67 | public static pb::MessageParser Parser { get { return _parser; } } 68 | 69 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 70 | public static pbr::MessageDescriptor Descriptor { 71 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[0]; } 72 | } 73 | 74 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 75 | pbr::MessageDescriptor pb::IMessage.Descriptor { 76 | get { return Descriptor; } 77 | } 78 | 79 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 80 | public Greeting() { 81 | OnConstruction(); 82 | } 83 | 84 | partial void OnConstruction(); 85 | 86 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 87 | public Greeting(Greeting other) : this() { 88 | firstName_ = other.firstName_; 89 | lastName_ = other.lastName_; 90 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 91 | } 92 | 93 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 94 | public Greeting Clone() { 95 | return new Greeting(this); 96 | } 97 | 98 | /// Field number for the "first_name" field. 99 | public const int FirstNameFieldNumber = 1; 100 | private string firstName_ = ""; 101 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 102 | public string FirstName { 103 | get { return firstName_; } 104 | set { 105 | firstName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 106 | } 107 | } 108 | 109 | /// Field number for the "last_name" field. 110 | public const int LastNameFieldNumber = 2; 111 | private string lastName_ = ""; 112 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 113 | public string LastName { 114 | get { return lastName_; } 115 | set { 116 | lastName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 117 | } 118 | } 119 | 120 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 121 | public override bool Equals(object other) { 122 | return Equals(other as Greeting); 123 | } 124 | 125 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 126 | public bool Equals(Greeting other) { 127 | if (ReferenceEquals(other, null)) { 128 | return false; 129 | } 130 | if (ReferenceEquals(other, this)) { 131 | return true; 132 | } 133 | if (FirstName != other.FirstName) return false; 134 | if (LastName != other.LastName) return false; 135 | return Equals(_unknownFields, other._unknownFields); 136 | } 137 | 138 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 139 | public override int GetHashCode() { 140 | int hash = 1; 141 | if (FirstName.Length != 0) hash ^= FirstName.GetHashCode(); 142 | if (LastName.Length != 0) hash ^= LastName.GetHashCode(); 143 | if (_unknownFields != null) { 144 | hash ^= _unknownFields.GetHashCode(); 145 | } 146 | return hash; 147 | } 148 | 149 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 150 | public override string ToString() { 151 | return pb::JsonFormatter.ToDiagnosticString(this); 152 | } 153 | 154 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 155 | public void WriteTo(pb::CodedOutputStream output) { 156 | if (FirstName.Length != 0) { 157 | output.WriteRawTag(10); 158 | output.WriteString(FirstName); 159 | } 160 | if (LastName.Length != 0) { 161 | output.WriteRawTag(18); 162 | output.WriteString(LastName); 163 | } 164 | if (_unknownFields != null) { 165 | _unknownFields.WriteTo(output); 166 | } 167 | } 168 | 169 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 170 | public int CalculateSize() { 171 | int size = 0; 172 | if (FirstName.Length != 0) { 173 | size += 1 + pb::CodedOutputStream.ComputeStringSize(FirstName); 174 | } 175 | if (LastName.Length != 0) { 176 | size += 1 + pb::CodedOutputStream.ComputeStringSize(LastName); 177 | } 178 | if (_unknownFields != null) { 179 | size += _unknownFields.CalculateSize(); 180 | } 181 | return size; 182 | } 183 | 184 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 185 | public void MergeFrom(Greeting other) { 186 | if (other == null) { 187 | return; 188 | } 189 | if (other.FirstName.Length != 0) { 190 | FirstName = other.FirstName; 191 | } 192 | if (other.LastName.Length != 0) { 193 | LastName = other.LastName; 194 | } 195 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 196 | } 197 | 198 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 199 | public void MergeFrom(pb::CodedInputStream input) { 200 | uint tag; 201 | while ((tag = input.ReadTag()) != 0) { 202 | switch(tag) { 203 | default: 204 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 205 | break; 206 | case 10: { 207 | FirstName = input.ReadString(); 208 | break; 209 | } 210 | case 18: { 211 | LastName = input.ReadString(); 212 | break; 213 | } 214 | } 215 | } 216 | } 217 | 218 | } 219 | 220 | public sealed partial class GreetingRequest : pb::IMessage { 221 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetingRequest()); 222 | private pb::UnknownFieldSet _unknownFields; 223 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 224 | public static pb::MessageParser Parser { get { return _parser; } } 225 | 226 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 227 | public static pbr::MessageDescriptor Descriptor { 228 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[1]; } 229 | } 230 | 231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 232 | pbr::MessageDescriptor pb::IMessage.Descriptor { 233 | get { return Descriptor; } 234 | } 235 | 236 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 237 | public GreetingRequest() { 238 | OnConstruction(); 239 | } 240 | 241 | partial void OnConstruction(); 242 | 243 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 244 | public GreetingRequest(GreetingRequest other) : this() { 245 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 246 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 247 | } 248 | 249 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 250 | public GreetingRequest Clone() { 251 | return new GreetingRequest(this); 252 | } 253 | 254 | /// Field number for the "greeting" field. 255 | public const int GreetingFieldNumber = 1; 256 | private global::Greet.Greeting greeting_; 257 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 258 | public global::Greet.Greeting Greeting { 259 | get { return greeting_; } 260 | set { 261 | greeting_ = value; 262 | } 263 | } 264 | 265 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 266 | public override bool Equals(object other) { 267 | return Equals(other as GreetingRequest); 268 | } 269 | 270 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 271 | public bool Equals(GreetingRequest other) { 272 | if (ReferenceEquals(other, null)) { 273 | return false; 274 | } 275 | if (ReferenceEquals(other, this)) { 276 | return true; 277 | } 278 | if (!object.Equals(Greeting, other.Greeting)) return false; 279 | return Equals(_unknownFields, other._unknownFields); 280 | } 281 | 282 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 283 | public override int GetHashCode() { 284 | int hash = 1; 285 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 286 | if (_unknownFields != null) { 287 | hash ^= _unknownFields.GetHashCode(); 288 | } 289 | return hash; 290 | } 291 | 292 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 293 | public override string ToString() { 294 | return pb::JsonFormatter.ToDiagnosticString(this); 295 | } 296 | 297 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 298 | public void WriteTo(pb::CodedOutputStream output) { 299 | if (greeting_ != null) { 300 | output.WriteRawTag(10); 301 | output.WriteMessage(Greeting); 302 | } 303 | if (_unknownFields != null) { 304 | _unknownFields.WriteTo(output); 305 | } 306 | } 307 | 308 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 309 | public int CalculateSize() { 310 | int size = 0; 311 | if (greeting_ != null) { 312 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 313 | } 314 | if (_unknownFields != null) { 315 | size += _unknownFields.CalculateSize(); 316 | } 317 | return size; 318 | } 319 | 320 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 321 | public void MergeFrom(GreetingRequest other) { 322 | if (other == null) { 323 | return; 324 | } 325 | if (other.greeting_ != null) { 326 | if (greeting_ == null) { 327 | Greeting = new global::Greet.Greeting(); 328 | } 329 | Greeting.MergeFrom(other.Greeting); 330 | } 331 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 332 | } 333 | 334 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 335 | public void MergeFrom(pb::CodedInputStream input) { 336 | uint tag; 337 | while ((tag = input.ReadTag()) != 0) { 338 | switch(tag) { 339 | default: 340 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 341 | break; 342 | case 10: { 343 | if (greeting_ == null) { 344 | Greeting = new global::Greet.Greeting(); 345 | } 346 | input.ReadMessage(Greeting); 347 | break; 348 | } 349 | } 350 | } 351 | } 352 | 353 | } 354 | 355 | public sealed partial class GreetingResponse : pb::IMessage { 356 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetingResponse()); 357 | private pb::UnknownFieldSet _unknownFields; 358 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 359 | public static pb::MessageParser Parser { get { return _parser; } } 360 | 361 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 362 | public static pbr::MessageDescriptor Descriptor { 363 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[2]; } 364 | } 365 | 366 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 367 | pbr::MessageDescriptor pb::IMessage.Descriptor { 368 | get { return Descriptor; } 369 | } 370 | 371 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 372 | public GreetingResponse() { 373 | OnConstruction(); 374 | } 375 | 376 | partial void OnConstruction(); 377 | 378 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 379 | public GreetingResponse(GreetingResponse other) : this() { 380 | result_ = other.result_; 381 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 382 | } 383 | 384 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 385 | public GreetingResponse Clone() { 386 | return new GreetingResponse(this); 387 | } 388 | 389 | /// Field number for the "result" field. 390 | public const int ResultFieldNumber = 1; 391 | private string result_ = ""; 392 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 393 | public string Result { 394 | get { return result_; } 395 | set { 396 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 397 | } 398 | } 399 | 400 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 401 | public override bool Equals(object other) { 402 | return Equals(other as GreetingResponse); 403 | } 404 | 405 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 406 | public bool Equals(GreetingResponse other) { 407 | if (ReferenceEquals(other, null)) { 408 | return false; 409 | } 410 | if (ReferenceEquals(other, this)) { 411 | return true; 412 | } 413 | if (Result != other.Result) return false; 414 | return Equals(_unknownFields, other._unknownFields); 415 | } 416 | 417 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 418 | public override int GetHashCode() { 419 | int hash = 1; 420 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 421 | if (_unknownFields != null) { 422 | hash ^= _unknownFields.GetHashCode(); 423 | } 424 | return hash; 425 | } 426 | 427 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 428 | public override string ToString() { 429 | return pb::JsonFormatter.ToDiagnosticString(this); 430 | } 431 | 432 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 433 | public void WriteTo(pb::CodedOutputStream output) { 434 | if (Result.Length != 0) { 435 | output.WriteRawTag(10); 436 | output.WriteString(Result); 437 | } 438 | if (_unknownFields != null) { 439 | _unknownFields.WriteTo(output); 440 | } 441 | } 442 | 443 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 444 | public int CalculateSize() { 445 | int size = 0; 446 | if (Result.Length != 0) { 447 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 448 | } 449 | if (_unknownFields != null) { 450 | size += _unknownFields.CalculateSize(); 451 | } 452 | return size; 453 | } 454 | 455 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 456 | public void MergeFrom(GreetingResponse other) { 457 | if (other == null) { 458 | return; 459 | } 460 | if (other.Result.Length != 0) { 461 | Result = other.Result; 462 | } 463 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 464 | } 465 | 466 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 467 | public void MergeFrom(pb::CodedInputStream input) { 468 | uint tag; 469 | while ((tag = input.ReadTag()) != 0) { 470 | switch(tag) { 471 | default: 472 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 473 | break; 474 | case 10: { 475 | Result = input.ReadString(); 476 | break; 477 | } 478 | } 479 | } 480 | } 481 | 482 | } 483 | 484 | public sealed partial class GreetManyTimesRequest : pb::IMessage { 485 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetManyTimesRequest()); 486 | private pb::UnknownFieldSet _unknownFields; 487 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 488 | public static pb::MessageParser Parser { get { return _parser; } } 489 | 490 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 491 | public static pbr::MessageDescriptor Descriptor { 492 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[3]; } 493 | } 494 | 495 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 496 | pbr::MessageDescriptor pb::IMessage.Descriptor { 497 | get { return Descriptor; } 498 | } 499 | 500 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 501 | public GreetManyTimesRequest() { 502 | OnConstruction(); 503 | } 504 | 505 | partial void OnConstruction(); 506 | 507 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 508 | public GreetManyTimesRequest(GreetManyTimesRequest other) : this() { 509 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 510 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 511 | } 512 | 513 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 514 | public GreetManyTimesRequest Clone() { 515 | return new GreetManyTimesRequest(this); 516 | } 517 | 518 | /// Field number for the "greeting" field. 519 | public const int GreetingFieldNumber = 1; 520 | private global::Greet.Greeting greeting_; 521 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 522 | public global::Greet.Greeting Greeting { 523 | get { return greeting_; } 524 | set { 525 | greeting_ = value; 526 | } 527 | } 528 | 529 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 530 | public override bool Equals(object other) { 531 | return Equals(other as GreetManyTimesRequest); 532 | } 533 | 534 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 535 | public bool Equals(GreetManyTimesRequest other) { 536 | if (ReferenceEquals(other, null)) { 537 | return false; 538 | } 539 | if (ReferenceEquals(other, this)) { 540 | return true; 541 | } 542 | if (!object.Equals(Greeting, other.Greeting)) return false; 543 | return Equals(_unknownFields, other._unknownFields); 544 | } 545 | 546 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 547 | public override int GetHashCode() { 548 | int hash = 1; 549 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 550 | if (_unknownFields != null) { 551 | hash ^= _unknownFields.GetHashCode(); 552 | } 553 | return hash; 554 | } 555 | 556 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 557 | public override string ToString() { 558 | return pb::JsonFormatter.ToDiagnosticString(this); 559 | } 560 | 561 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 562 | public void WriteTo(pb::CodedOutputStream output) { 563 | if (greeting_ != null) { 564 | output.WriteRawTag(10); 565 | output.WriteMessage(Greeting); 566 | } 567 | if (_unknownFields != null) { 568 | _unknownFields.WriteTo(output); 569 | } 570 | } 571 | 572 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 573 | public int CalculateSize() { 574 | int size = 0; 575 | if (greeting_ != null) { 576 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 577 | } 578 | if (_unknownFields != null) { 579 | size += _unknownFields.CalculateSize(); 580 | } 581 | return size; 582 | } 583 | 584 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 585 | public void MergeFrom(GreetManyTimesRequest other) { 586 | if (other == null) { 587 | return; 588 | } 589 | if (other.greeting_ != null) { 590 | if (greeting_ == null) { 591 | Greeting = new global::Greet.Greeting(); 592 | } 593 | Greeting.MergeFrom(other.Greeting); 594 | } 595 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 596 | } 597 | 598 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 599 | public void MergeFrom(pb::CodedInputStream input) { 600 | uint tag; 601 | while ((tag = input.ReadTag()) != 0) { 602 | switch(tag) { 603 | default: 604 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 605 | break; 606 | case 10: { 607 | if (greeting_ == null) { 608 | Greeting = new global::Greet.Greeting(); 609 | } 610 | input.ReadMessage(Greeting); 611 | break; 612 | } 613 | } 614 | } 615 | } 616 | 617 | } 618 | 619 | public sealed partial class GreetManyTimesResponse : pb::IMessage { 620 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetManyTimesResponse()); 621 | private pb::UnknownFieldSet _unknownFields; 622 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 623 | public static pb::MessageParser Parser { get { return _parser; } } 624 | 625 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 626 | public static pbr::MessageDescriptor Descriptor { 627 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[4]; } 628 | } 629 | 630 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 631 | pbr::MessageDescriptor pb::IMessage.Descriptor { 632 | get { return Descriptor; } 633 | } 634 | 635 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 636 | public GreetManyTimesResponse() { 637 | OnConstruction(); 638 | } 639 | 640 | partial void OnConstruction(); 641 | 642 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 643 | public GreetManyTimesResponse(GreetManyTimesResponse other) : this() { 644 | result_ = other.result_; 645 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 646 | } 647 | 648 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 649 | public GreetManyTimesResponse Clone() { 650 | return new GreetManyTimesResponse(this); 651 | } 652 | 653 | /// Field number for the "result" field. 654 | public const int ResultFieldNumber = 1; 655 | private string result_ = ""; 656 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 657 | public string Result { 658 | get { return result_; } 659 | set { 660 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 661 | } 662 | } 663 | 664 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 665 | public override bool Equals(object other) { 666 | return Equals(other as GreetManyTimesResponse); 667 | } 668 | 669 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 670 | public bool Equals(GreetManyTimesResponse other) { 671 | if (ReferenceEquals(other, null)) { 672 | return false; 673 | } 674 | if (ReferenceEquals(other, this)) { 675 | return true; 676 | } 677 | if (Result != other.Result) return false; 678 | return Equals(_unknownFields, other._unknownFields); 679 | } 680 | 681 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 682 | public override int GetHashCode() { 683 | int hash = 1; 684 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 685 | if (_unknownFields != null) { 686 | hash ^= _unknownFields.GetHashCode(); 687 | } 688 | return hash; 689 | } 690 | 691 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 692 | public override string ToString() { 693 | return pb::JsonFormatter.ToDiagnosticString(this); 694 | } 695 | 696 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 697 | public void WriteTo(pb::CodedOutputStream output) { 698 | if (Result.Length != 0) { 699 | output.WriteRawTag(10); 700 | output.WriteString(Result); 701 | } 702 | if (_unknownFields != null) { 703 | _unknownFields.WriteTo(output); 704 | } 705 | } 706 | 707 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 708 | public int CalculateSize() { 709 | int size = 0; 710 | if (Result.Length != 0) { 711 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 712 | } 713 | if (_unknownFields != null) { 714 | size += _unknownFields.CalculateSize(); 715 | } 716 | return size; 717 | } 718 | 719 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 720 | public void MergeFrom(GreetManyTimesResponse other) { 721 | if (other == null) { 722 | return; 723 | } 724 | if (other.Result.Length != 0) { 725 | Result = other.Result; 726 | } 727 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 728 | } 729 | 730 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 731 | public void MergeFrom(pb::CodedInputStream input) { 732 | uint tag; 733 | while ((tag = input.ReadTag()) != 0) { 734 | switch(tag) { 735 | default: 736 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 737 | break; 738 | case 10: { 739 | Result = input.ReadString(); 740 | break; 741 | } 742 | } 743 | } 744 | } 745 | 746 | } 747 | 748 | public sealed partial class LongGreetRequest : pb::IMessage { 749 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongGreetRequest()); 750 | private pb::UnknownFieldSet _unknownFields; 751 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 752 | public static pb::MessageParser Parser { get { return _parser; } } 753 | 754 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 755 | public static pbr::MessageDescriptor Descriptor { 756 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[5]; } 757 | } 758 | 759 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 760 | pbr::MessageDescriptor pb::IMessage.Descriptor { 761 | get { return Descriptor; } 762 | } 763 | 764 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 765 | public LongGreetRequest() { 766 | OnConstruction(); 767 | } 768 | 769 | partial void OnConstruction(); 770 | 771 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 772 | public LongGreetRequest(LongGreetRequest other) : this() { 773 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 774 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 775 | } 776 | 777 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 778 | public LongGreetRequest Clone() { 779 | return new LongGreetRequest(this); 780 | } 781 | 782 | /// Field number for the "greeting" field. 783 | public const int GreetingFieldNumber = 1; 784 | private global::Greet.Greeting greeting_; 785 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 786 | public global::Greet.Greeting Greeting { 787 | get { return greeting_; } 788 | set { 789 | greeting_ = value; 790 | } 791 | } 792 | 793 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 794 | public override bool Equals(object other) { 795 | return Equals(other as LongGreetRequest); 796 | } 797 | 798 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 799 | public bool Equals(LongGreetRequest other) { 800 | if (ReferenceEquals(other, null)) { 801 | return false; 802 | } 803 | if (ReferenceEquals(other, this)) { 804 | return true; 805 | } 806 | if (!object.Equals(Greeting, other.Greeting)) return false; 807 | return Equals(_unknownFields, other._unknownFields); 808 | } 809 | 810 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 811 | public override int GetHashCode() { 812 | int hash = 1; 813 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 814 | if (_unknownFields != null) { 815 | hash ^= _unknownFields.GetHashCode(); 816 | } 817 | return hash; 818 | } 819 | 820 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 821 | public override string ToString() { 822 | return pb::JsonFormatter.ToDiagnosticString(this); 823 | } 824 | 825 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 826 | public void WriteTo(pb::CodedOutputStream output) { 827 | if (greeting_ != null) { 828 | output.WriteRawTag(10); 829 | output.WriteMessage(Greeting); 830 | } 831 | if (_unknownFields != null) { 832 | _unknownFields.WriteTo(output); 833 | } 834 | } 835 | 836 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 837 | public int CalculateSize() { 838 | int size = 0; 839 | if (greeting_ != null) { 840 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 841 | } 842 | if (_unknownFields != null) { 843 | size += _unknownFields.CalculateSize(); 844 | } 845 | return size; 846 | } 847 | 848 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 849 | public void MergeFrom(LongGreetRequest other) { 850 | if (other == null) { 851 | return; 852 | } 853 | if (other.greeting_ != null) { 854 | if (greeting_ == null) { 855 | Greeting = new global::Greet.Greeting(); 856 | } 857 | Greeting.MergeFrom(other.Greeting); 858 | } 859 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 860 | } 861 | 862 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 863 | public void MergeFrom(pb::CodedInputStream input) { 864 | uint tag; 865 | while ((tag = input.ReadTag()) != 0) { 866 | switch(tag) { 867 | default: 868 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 869 | break; 870 | case 10: { 871 | if (greeting_ == null) { 872 | Greeting = new global::Greet.Greeting(); 873 | } 874 | input.ReadMessage(Greeting); 875 | break; 876 | } 877 | } 878 | } 879 | } 880 | 881 | } 882 | 883 | public sealed partial class LongGreetResponse : pb::IMessage { 884 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LongGreetResponse()); 885 | private pb::UnknownFieldSet _unknownFields; 886 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 887 | public static pb::MessageParser Parser { get { return _parser; } } 888 | 889 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 890 | public static pbr::MessageDescriptor Descriptor { 891 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[6]; } 892 | } 893 | 894 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 895 | pbr::MessageDescriptor pb::IMessage.Descriptor { 896 | get { return Descriptor; } 897 | } 898 | 899 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 900 | public LongGreetResponse() { 901 | OnConstruction(); 902 | } 903 | 904 | partial void OnConstruction(); 905 | 906 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 907 | public LongGreetResponse(LongGreetResponse other) : this() { 908 | result_ = other.result_; 909 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 910 | } 911 | 912 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 913 | public LongGreetResponse Clone() { 914 | return new LongGreetResponse(this); 915 | } 916 | 917 | /// Field number for the "result" field. 918 | public const int ResultFieldNumber = 1; 919 | private string result_ = ""; 920 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 921 | public string Result { 922 | get { return result_; } 923 | set { 924 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 925 | } 926 | } 927 | 928 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 929 | public override bool Equals(object other) { 930 | return Equals(other as LongGreetResponse); 931 | } 932 | 933 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 934 | public bool Equals(LongGreetResponse other) { 935 | if (ReferenceEquals(other, null)) { 936 | return false; 937 | } 938 | if (ReferenceEquals(other, this)) { 939 | return true; 940 | } 941 | if (Result != other.Result) return false; 942 | return Equals(_unknownFields, other._unknownFields); 943 | } 944 | 945 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 946 | public override int GetHashCode() { 947 | int hash = 1; 948 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 949 | if (_unknownFields != null) { 950 | hash ^= _unknownFields.GetHashCode(); 951 | } 952 | return hash; 953 | } 954 | 955 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 956 | public override string ToString() { 957 | return pb::JsonFormatter.ToDiagnosticString(this); 958 | } 959 | 960 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 961 | public void WriteTo(pb::CodedOutputStream output) { 962 | if (Result.Length != 0) { 963 | output.WriteRawTag(10); 964 | output.WriteString(Result); 965 | } 966 | if (_unknownFields != null) { 967 | _unknownFields.WriteTo(output); 968 | } 969 | } 970 | 971 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 972 | public int CalculateSize() { 973 | int size = 0; 974 | if (Result.Length != 0) { 975 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 976 | } 977 | if (_unknownFields != null) { 978 | size += _unknownFields.CalculateSize(); 979 | } 980 | return size; 981 | } 982 | 983 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 984 | public void MergeFrom(LongGreetResponse other) { 985 | if (other == null) { 986 | return; 987 | } 988 | if (other.Result.Length != 0) { 989 | Result = other.Result; 990 | } 991 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 992 | } 993 | 994 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 995 | public void MergeFrom(pb::CodedInputStream input) { 996 | uint tag; 997 | while ((tag = input.ReadTag()) != 0) { 998 | switch(tag) { 999 | default: 1000 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1001 | break; 1002 | case 10: { 1003 | Result = input.ReadString(); 1004 | break; 1005 | } 1006 | } 1007 | } 1008 | } 1009 | 1010 | } 1011 | 1012 | public sealed partial class GreetEveryoneRequest : pb::IMessage { 1013 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetEveryoneRequest()); 1014 | private pb::UnknownFieldSet _unknownFields; 1015 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1016 | public static pb::MessageParser Parser { get { return _parser; } } 1017 | 1018 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1019 | public static pbr::MessageDescriptor Descriptor { 1020 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[7]; } 1021 | } 1022 | 1023 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1024 | pbr::MessageDescriptor pb::IMessage.Descriptor { 1025 | get { return Descriptor; } 1026 | } 1027 | 1028 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1029 | public GreetEveryoneRequest() { 1030 | OnConstruction(); 1031 | } 1032 | 1033 | partial void OnConstruction(); 1034 | 1035 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1036 | public GreetEveryoneRequest(GreetEveryoneRequest other) : this() { 1037 | greeting_ = other.greeting_ != null ? other.greeting_.Clone() : null; 1038 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1039 | } 1040 | 1041 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1042 | public GreetEveryoneRequest Clone() { 1043 | return new GreetEveryoneRequest(this); 1044 | } 1045 | 1046 | /// Field number for the "greeting" field. 1047 | public const int GreetingFieldNumber = 1; 1048 | private global::Greet.Greeting greeting_; 1049 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1050 | public global::Greet.Greeting Greeting { 1051 | get { return greeting_; } 1052 | set { 1053 | greeting_ = value; 1054 | } 1055 | } 1056 | 1057 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1058 | public override bool Equals(object other) { 1059 | return Equals(other as GreetEveryoneRequest); 1060 | } 1061 | 1062 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1063 | public bool Equals(GreetEveryoneRequest other) { 1064 | if (ReferenceEquals(other, null)) { 1065 | return false; 1066 | } 1067 | if (ReferenceEquals(other, this)) { 1068 | return true; 1069 | } 1070 | if (!object.Equals(Greeting, other.Greeting)) return false; 1071 | return Equals(_unknownFields, other._unknownFields); 1072 | } 1073 | 1074 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1075 | public override int GetHashCode() { 1076 | int hash = 1; 1077 | if (greeting_ != null) hash ^= Greeting.GetHashCode(); 1078 | if (_unknownFields != null) { 1079 | hash ^= _unknownFields.GetHashCode(); 1080 | } 1081 | return hash; 1082 | } 1083 | 1084 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1085 | public override string ToString() { 1086 | return pb::JsonFormatter.ToDiagnosticString(this); 1087 | } 1088 | 1089 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1090 | public void WriteTo(pb::CodedOutputStream output) { 1091 | if (greeting_ != null) { 1092 | output.WriteRawTag(10); 1093 | output.WriteMessage(Greeting); 1094 | } 1095 | if (_unknownFields != null) { 1096 | _unknownFields.WriteTo(output); 1097 | } 1098 | } 1099 | 1100 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1101 | public int CalculateSize() { 1102 | int size = 0; 1103 | if (greeting_ != null) { 1104 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Greeting); 1105 | } 1106 | if (_unknownFields != null) { 1107 | size += _unknownFields.CalculateSize(); 1108 | } 1109 | return size; 1110 | } 1111 | 1112 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1113 | public void MergeFrom(GreetEveryoneRequest other) { 1114 | if (other == null) { 1115 | return; 1116 | } 1117 | if (other.greeting_ != null) { 1118 | if (greeting_ == null) { 1119 | Greeting = new global::Greet.Greeting(); 1120 | } 1121 | Greeting.MergeFrom(other.Greeting); 1122 | } 1123 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1124 | } 1125 | 1126 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1127 | public void MergeFrom(pb::CodedInputStream input) { 1128 | uint tag; 1129 | while ((tag = input.ReadTag()) != 0) { 1130 | switch(tag) { 1131 | default: 1132 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1133 | break; 1134 | case 10: { 1135 | if (greeting_ == null) { 1136 | Greeting = new global::Greet.Greeting(); 1137 | } 1138 | input.ReadMessage(Greeting); 1139 | break; 1140 | } 1141 | } 1142 | } 1143 | } 1144 | 1145 | } 1146 | 1147 | public sealed partial class GreetEveryoneResponse : pb::IMessage { 1148 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GreetEveryoneResponse()); 1149 | private pb::UnknownFieldSet _unknownFields; 1150 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1151 | public static pb::MessageParser Parser { get { return _parser; } } 1152 | 1153 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1154 | public static pbr::MessageDescriptor Descriptor { 1155 | get { return global::Greet.GreetingReflection.Descriptor.MessageTypes[8]; } 1156 | } 1157 | 1158 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1159 | pbr::MessageDescriptor pb::IMessage.Descriptor { 1160 | get { return Descriptor; } 1161 | } 1162 | 1163 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1164 | public GreetEveryoneResponse() { 1165 | OnConstruction(); 1166 | } 1167 | 1168 | partial void OnConstruction(); 1169 | 1170 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1171 | public GreetEveryoneResponse(GreetEveryoneResponse other) : this() { 1172 | result_ = other.result_; 1173 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 1174 | } 1175 | 1176 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1177 | public GreetEveryoneResponse Clone() { 1178 | return new GreetEveryoneResponse(this); 1179 | } 1180 | 1181 | /// Field number for the "result" field. 1182 | public const int ResultFieldNumber = 1; 1183 | private string result_ = ""; 1184 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1185 | public string Result { 1186 | get { return result_; } 1187 | set { 1188 | result_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 1189 | } 1190 | } 1191 | 1192 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1193 | public override bool Equals(object other) { 1194 | return Equals(other as GreetEveryoneResponse); 1195 | } 1196 | 1197 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1198 | public bool Equals(GreetEveryoneResponse other) { 1199 | if (ReferenceEquals(other, null)) { 1200 | return false; 1201 | } 1202 | if (ReferenceEquals(other, this)) { 1203 | return true; 1204 | } 1205 | if (Result != other.Result) return false; 1206 | return Equals(_unknownFields, other._unknownFields); 1207 | } 1208 | 1209 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1210 | public override int GetHashCode() { 1211 | int hash = 1; 1212 | if (Result.Length != 0) hash ^= Result.GetHashCode(); 1213 | if (_unknownFields != null) { 1214 | hash ^= _unknownFields.GetHashCode(); 1215 | } 1216 | return hash; 1217 | } 1218 | 1219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1220 | public override string ToString() { 1221 | return pb::JsonFormatter.ToDiagnosticString(this); 1222 | } 1223 | 1224 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1225 | public void WriteTo(pb::CodedOutputStream output) { 1226 | if (Result.Length != 0) { 1227 | output.WriteRawTag(10); 1228 | output.WriteString(Result); 1229 | } 1230 | if (_unknownFields != null) { 1231 | _unknownFields.WriteTo(output); 1232 | } 1233 | } 1234 | 1235 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1236 | public int CalculateSize() { 1237 | int size = 0; 1238 | if (Result.Length != 0) { 1239 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Result); 1240 | } 1241 | if (_unknownFields != null) { 1242 | size += _unknownFields.CalculateSize(); 1243 | } 1244 | return size; 1245 | } 1246 | 1247 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1248 | public void MergeFrom(GreetEveryoneResponse other) { 1249 | if (other == null) { 1250 | return; 1251 | } 1252 | if (other.Result.Length != 0) { 1253 | Result = other.Result; 1254 | } 1255 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 1256 | } 1257 | 1258 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 1259 | public void MergeFrom(pb::CodedInputStream input) { 1260 | uint tag; 1261 | while ((tag = input.ReadTag()) != 0) { 1262 | switch(tag) { 1263 | default: 1264 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 1265 | break; 1266 | case 10: { 1267 | Result = input.ReadString(); 1268 | break; 1269 | } 1270 | } 1271 | } 1272 | } 1273 | 1274 | } 1275 | 1276 | #endregion 1277 | 1278 | } 1279 | 1280 | #endregion Designer generated code 1281 | -------------------------------------------------------------------------------- /server/models/GreetingGrpc.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! 3 | // source: greeting.proto 4 | // 5 | #pragma warning disable 0414, 1591 6 | #region Designer generated code 7 | 8 | using grpc = global::Grpc.Core; 9 | 10 | namespace Greet { 11 | public static partial class GreetingService 12 | { 13 | static readonly string __ServiceName = "greet.GreetingService"; 14 | 15 | static readonly grpc::Marshaller __Marshaller_greet_GreetingRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetingRequest.Parser.ParseFrom); 16 | static readonly grpc::Marshaller __Marshaller_greet_GreetingResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetingResponse.Parser.ParseFrom); 17 | static readonly grpc::Marshaller __Marshaller_greet_GreetManyTimesRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetManyTimesRequest.Parser.ParseFrom); 18 | static readonly grpc::Marshaller __Marshaller_greet_GreetManyTimesResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetManyTimesResponse.Parser.ParseFrom); 19 | static readonly grpc::Marshaller __Marshaller_greet_LongGreetRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.LongGreetRequest.Parser.ParseFrom); 20 | static readonly grpc::Marshaller __Marshaller_greet_LongGreetResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.LongGreetResponse.Parser.ParseFrom); 21 | static readonly grpc::Marshaller __Marshaller_greet_GreetEveryoneRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetEveryoneRequest.Parser.ParseFrom); 22 | static readonly grpc::Marshaller __Marshaller_greet_GreetEveryoneResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Greet.GreetEveryoneResponse.Parser.ParseFrom); 23 | 24 | static readonly grpc::Method __Method_Greet = new grpc::Method( 25 | grpc::MethodType.Unary, 26 | __ServiceName, 27 | "Greet", 28 | __Marshaller_greet_GreetingRequest, 29 | __Marshaller_greet_GreetingResponse); 30 | 31 | static readonly grpc::Method __Method_GreetManyTimes = new grpc::Method( 32 | grpc::MethodType.ServerStreaming, 33 | __ServiceName, 34 | "GreetManyTimes", 35 | __Marshaller_greet_GreetManyTimesRequest, 36 | __Marshaller_greet_GreetManyTimesResponse); 37 | 38 | static readonly grpc::Method __Method_LongGreet = new grpc::Method( 39 | grpc::MethodType.ClientStreaming, 40 | __ServiceName, 41 | "LongGreet", 42 | __Marshaller_greet_LongGreetRequest, 43 | __Marshaller_greet_LongGreetResponse); 44 | 45 | static readonly grpc::Method __Method_GreetEveryone = new grpc::Method( 46 | grpc::MethodType.DuplexStreaming, 47 | __ServiceName, 48 | "GreetEveryone", 49 | __Marshaller_greet_GreetEveryoneRequest, 50 | __Marshaller_greet_GreetEveryoneResponse); 51 | 52 | /// Service descriptor 53 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 54 | { 55 | get { return global::Greet.GreetingReflection.Descriptor.Services[0]; } 56 | } 57 | 58 | /// Base class for server-side implementations of GreetingService 59 | [grpc::BindServiceMethod(typeof(GreetingService), "BindService")] 60 | public abstract partial class GreetingServiceBase 61 | { 62 | /// 63 | /// Unary 64 | /// 65 | /// The request received from the client. 66 | /// The context of the server-side call handler being invoked. 67 | /// The response to send back to the client (wrapped by a task). 68 | public virtual global::System.Threading.Tasks.Task Greet(global::Greet.GreetingRequest request, grpc::ServerCallContext context) 69 | { 70 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 71 | } 72 | 73 | /// 74 | /// Server streaming 75 | /// 76 | /// The request received from the client. 77 | /// Used for sending responses back to the client. 78 | /// The context of the server-side call handler being invoked. 79 | /// A task indicating completion of the handler. 80 | public virtual global::System.Threading.Tasks.Task GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) 81 | { 82 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 83 | } 84 | 85 | /// 86 | /// Client streaming 87 | /// 88 | /// Used for reading requests from the client. 89 | /// The context of the server-side call handler being invoked. 90 | /// The response to send back to the client (wrapped by a task). 91 | public virtual global::System.Threading.Tasks.Task LongGreet(grpc::IAsyncStreamReader requestStream, grpc::ServerCallContext context) 92 | { 93 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 94 | } 95 | 96 | /// 97 | /// Bidi streaming 98 | /// 99 | /// Used for reading requests from the client. 100 | /// Used for sending responses back to the client. 101 | /// The context of the server-side call handler being invoked. 102 | /// A task indicating completion of the handler. 103 | public virtual global::System.Threading.Tasks.Task GreetEveryone(grpc::IAsyncStreamReader requestStream, grpc::IServerStreamWriter responseStream, grpc::ServerCallContext context) 104 | { 105 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 106 | } 107 | 108 | } 109 | 110 | /// Client for GreetingService 111 | public partial class GreetingServiceClient : grpc::ClientBase 112 | { 113 | /// Creates a new client for GreetingService 114 | /// The channel to use to make remote calls. 115 | public GreetingServiceClient(grpc::ChannelBase channel) : base(channel) 116 | { 117 | } 118 | /// Creates a new client for GreetingService that uses a custom CallInvoker. 119 | /// The callInvoker to use to make remote calls. 120 | public GreetingServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 121 | { 122 | } 123 | /// Protected parameterless constructor to allow creation of test doubles. 124 | protected GreetingServiceClient() : base() 125 | { 126 | } 127 | /// Protected constructor to allow creation of configured clients. 128 | /// The client configuration. 129 | protected GreetingServiceClient(ClientBaseConfiguration configuration) : base(configuration) 130 | { 131 | } 132 | 133 | /// 134 | /// Unary 135 | /// 136 | /// The request to send to the server. 137 | /// The initial metadata to send with the call. This parameter is optional. 138 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 139 | /// An optional token for canceling the call. 140 | /// The response received from the server. 141 | public virtual global::Greet.GreetingResponse Greet(global::Greet.GreetingRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 142 | { 143 | return Greet(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 144 | } 145 | /// 146 | /// Unary 147 | /// 148 | /// The request to send to the server. 149 | /// The options for the call. 150 | /// The response received from the server. 151 | public virtual global::Greet.GreetingResponse Greet(global::Greet.GreetingRequest request, grpc::CallOptions options) 152 | { 153 | return CallInvoker.BlockingUnaryCall(__Method_Greet, null, options, request); 154 | } 155 | /// 156 | /// Unary 157 | /// 158 | /// The request to send to the server. 159 | /// The initial metadata to send with the call. This parameter is optional. 160 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 161 | /// An optional token for canceling the call. 162 | /// The call object. 163 | public virtual grpc::AsyncUnaryCall GreetAsync(global::Greet.GreetingRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 164 | { 165 | return GreetAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 166 | } 167 | /// 168 | /// Unary 169 | /// 170 | /// The request to send to the server. 171 | /// The options for the call. 172 | /// The call object. 173 | public virtual grpc::AsyncUnaryCall GreetAsync(global::Greet.GreetingRequest request, grpc::CallOptions options) 174 | { 175 | return CallInvoker.AsyncUnaryCall(__Method_Greet, null, options, request); 176 | } 177 | /// 178 | /// Server streaming 179 | /// 180 | /// The request to send to the server. 181 | /// The initial metadata to send with the call. This parameter is optional. 182 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 183 | /// An optional token for canceling the call. 184 | /// The call object. 185 | public virtual grpc::AsyncServerStreamingCall GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 186 | { 187 | return GreetManyTimes(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 188 | } 189 | /// 190 | /// Server streaming 191 | /// 192 | /// The request to send to the server. 193 | /// The options for the call. 194 | /// The call object. 195 | public virtual grpc::AsyncServerStreamingCall GreetManyTimes(global::Greet.GreetManyTimesRequest request, grpc::CallOptions options) 196 | { 197 | return CallInvoker.AsyncServerStreamingCall(__Method_GreetManyTimes, null, options, request); 198 | } 199 | /// 200 | /// Client streaming 201 | /// 202 | /// The initial metadata to send with the call. This parameter is optional. 203 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 204 | /// An optional token for canceling the call. 205 | /// The call object. 206 | public virtual grpc::AsyncClientStreamingCall LongGreet(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 207 | { 208 | return LongGreet(new grpc::CallOptions(headers, deadline, cancellationToken)); 209 | } 210 | /// 211 | /// Client streaming 212 | /// 213 | /// The options for the call. 214 | /// The call object. 215 | public virtual grpc::AsyncClientStreamingCall LongGreet(grpc::CallOptions options) 216 | { 217 | return CallInvoker.AsyncClientStreamingCall(__Method_LongGreet, null, options); 218 | } 219 | /// 220 | /// Bidi streaming 221 | /// 222 | /// The initial metadata to send with the call. This parameter is optional. 223 | /// An optional deadline for the call. The call will be cancelled if deadline is hit. 224 | /// An optional token for canceling the call. 225 | /// The call object. 226 | public virtual grpc::AsyncDuplexStreamingCall GreetEveryone(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 227 | { 228 | return GreetEveryone(new grpc::CallOptions(headers, deadline, cancellationToken)); 229 | } 230 | /// 231 | /// Bidi streaming 232 | /// 233 | /// The options for the call. 234 | /// The call object. 235 | public virtual grpc::AsyncDuplexStreamingCall GreetEveryone(grpc::CallOptions options) 236 | { 237 | return CallInvoker.AsyncDuplexStreamingCall(__Method_GreetEveryone, null, options); 238 | } 239 | /// Creates a new instance of client from given ClientBaseConfiguration. 240 | protected override GreetingServiceClient NewInstance(ClientBaseConfiguration configuration) 241 | { 242 | return new GreetingServiceClient(configuration); 243 | } 244 | } 245 | 246 | /// Creates service definition that can be registered with a server 247 | /// An object implementing the server-side handling logic. 248 | public static grpc::ServerServiceDefinition BindService(GreetingServiceBase serviceImpl) 249 | { 250 | return grpc::ServerServiceDefinition.CreateBuilder() 251 | .AddMethod(__Method_Greet, serviceImpl.Greet) 252 | .AddMethod(__Method_GreetManyTimes, serviceImpl.GreetManyTimes) 253 | .AddMethod(__Method_LongGreet, serviceImpl.LongGreet) 254 | .AddMethod(__Method_GreetEveryone, serviceImpl.GreetEveryone).Build(); 255 | } 256 | 257 | /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 258 | /// Note: this method is part of an experimental API that can change or be removed without any prior notice. 259 | /// Service methods will be bound by calling AddMethod on this object. 260 | /// An object implementing the server-side handling logic. 261 | public static void BindService(grpc::ServiceBinderBase serviceBinder, GreetingServiceBase serviceImpl) 262 | { 263 | serviceBinder.AddMethod(__Method_Greet, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.Greet)); 264 | serviceBinder.AddMethod(__Method_GreetManyTimes, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.GreetManyTimes)); 265 | serviceBinder.AddMethod(__Method_LongGreet, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod(serviceImpl.LongGreet)); 266 | serviceBinder.AddMethod(__Method_GreetEveryone, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod(serviceImpl.GreetEveryone)); 267 | } 268 | 269 | } 270 | } 271 | #endregion 272 | -------------------------------------------------------------------------------- /server/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /server/server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {F101CBD9-E27E-4D1B-9A20-6B2E404714C8} 9 | Exe 10 | server 11 | server 12 | v4.7.2 13 | 512 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | ..\packages\Google.Protobuf.3.10.0\lib\net45\Google.Protobuf.dll 41 | 42 | 43 | ..\packages\Grpc.Core.2.24.0\lib\net45\Grpc.Core.dll 44 | 45 | 46 | ..\packages\Grpc.Core.Api.2.24.0\lib\net45\Grpc.Core.Api.dll 47 | 48 | 49 | ..\packages\Grpc.Reflection.2.24.0\lib\net45\Grpc.Reflection.dll 50 | 51 | 52 | 53 | ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll 54 | 55 | 56 | 57 | ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll 58 | 59 | 60 | 61 | ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll 62 | 63 | 64 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | PreserveNewest 86 | 87 | 88 | PreserveNewest 89 | 90 | 91 | PreserveNewest 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /ssl/ssl.sh: -------------------------------------------------------------------------------- 1 | @echo off 2 | SERVER_CN=localhost 3 | set OPENSSL_CONF=c:\OpenSSL-Win64\bin\openssl.cfg 4 | 5 | echo Generate CA key: 6 | openssl genrsa -passout pass:1111 -des3 -out ca.key 4096 7 | 8 | echo Generate CA certificate: 9 | openssl req -passin pass:1111 -new -x509 -days 365 -key ca.key -out ca.crt -subj "//CN=MyRootCA" 10 | 11 | echo Generate server key: 12 | openssl genrsa -passout pass:1111 -des3 -out server.key 4096 13 | 14 | echo Generate server signing request: 15 | openssl req -passin pass:1111 -new -key server.key -out server.csr -subj "//CN=${SERVER_CN}" 16 | 17 | echo Self-sign server certificate: 18 | openssl x509 -req -passin pass:1111 -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt 19 | 20 | echo Remove passphrase from server key: 21 | openssl rsa -passin pass:1111 -in server.key -out server.key 22 | 23 | echo Generate client key 24 | openssl genrsa -passout pass:1111 -des3 -out client.key 4096 25 | 26 | echo Generate client signing request: 27 | openssl req -passin pass:1111 -new -key client.key -out client.csr -subj "//CN=${SERVER_CN}" 28 | 29 | echo Self-sign client certificate: 30 | openssl x509 -passin pass:1111 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt 31 | 32 | echo Remove passphrase from client key: 33 | openssl rsa -passin pass:1111 -in client.key -out client.key 34 | 35 | cp ca.crt ../server/ssl/ca.crt 36 | cp ca.crt ../client/ssl/ca.crt 37 | 38 | mv server.crt ../server/ssl/server.crt 39 | mv server.key ../server/ssl/server.key 40 | 41 | mv client.crt ../client/ssl/client.crt 42 | mv client.key ../client/ssl/client.key --------------------------------------------------------------------------------