ServerRpcNew.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #region Copyright notice and license
  2. // Copyright 2015, Google Inc.
  3. // All rights reserved.
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. #endregion
  31. using System;
  32. using Grpc.Core;
  33. namespace Grpc.Core.Internal
  34. {
  35. /// <summary>
  36. /// Details of a newly received RPC.
  37. /// </summary>
  38. internal struct ServerRpcNew
  39. {
  40. readonly Server server;
  41. readonly CallSafeHandle call;
  42. readonly string method;
  43. readonly string host;
  44. readonly Timespec deadline;
  45. readonly Metadata requestMetadata;
  46. public ServerRpcNew(Server server, CallSafeHandle call, string method, string host, Timespec deadline, Metadata requestMetadata)
  47. {
  48. this.server = server;
  49. this.call = call;
  50. this.method = method;
  51. this.host = host;
  52. this.deadline = deadline;
  53. this.requestMetadata = requestMetadata;
  54. }
  55. public Server Server
  56. {
  57. get
  58. {
  59. return this.server;
  60. }
  61. }
  62. public CallSafeHandle Call
  63. {
  64. get
  65. {
  66. return this.call;
  67. }
  68. }
  69. public string Method
  70. {
  71. get
  72. {
  73. return this.method;
  74. }
  75. }
  76. public string Host
  77. {
  78. get
  79. {
  80. return this.host;
  81. }
  82. }
  83. public Timespec Deadline
  84. {
  85. get
  86. {
  87. return this.deadline;
  88. }
  89. }
  90. public Metadata RequestMetadata
  91. {
  92. get
  93. {
  94. return this.requestMetadata;
  95. }
  96. }
  97. }
  98. }