ServerRpcNew.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #region Copyright notice and license
  2. // Copyright 2015 gRPC authors.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. #endregion
  16. using System;
  17. using Grpc.Core;
  18. namespace Grpc.Core.Internal
  19. {
  20. /// <summary>
  21. /// Details of a newly received RPC.
  22. /// </summary>
  23. internal struct ServerRpcNew
  24. {
  25. readonly Server server;
  26. readonly CallSafeHandle call;
  27. readonly string method;
  28. readonly string host;
  29. readonly Timespec deadline;
  30. readonly Metadata requestMetadata;
  31. public ServerRpcNew(Server server, CallSafeHandle call, string method, string host, Timespec deadline, Metadata requestMetadata)
  32. {
  33. this.server = server;
  34. this.call = call;
  35. this.method = method;
  36. this.host = host;
  37. this.deadline = deadline;
  38. this.requestMetadata = requestMetadata;
  39. }
  40. public Server Server
  41. {
  42. get
  43. {
  44. return this.server;
  45. }
  46. }
  47. public CallSafeHandle Call
  48. {
  49. get
  50. {
  51. return this.call;
  52. }
  53. }
  54. public string Method
  55. {
  56. get
  57. {
  58. return this.method;
  59. }
  60. }
  61. public string Host
  62. {
  63. get
  64. {
  65. return this.host;
  66. }
  67. }
  68. public Timespec Deadline
  69. {
  70. get
  71. {
  72. return this.deadline;
  73. }
  74. }
  75. public Metadata RequestMetadata
  76. {
  77. get
  78. {
  79. return this.requestMetadata;
  80. }
  81. }
  82. }
  83. }