IRpcChannel.cs 1.3 KB

12345678910111213141516171819202122232425
  1. using System;
  2. using Google.ProtocolBuffers.Descriptors;
  3. namespace Google.ProtocolBuffers {
  4. /// <summary>
  5. /// Interface for an RPC channel. A channel represents a communication line to
  6. /// a service (IService implementation) which can be used to call that service's
  7. /// methods. The service may be running on another machine. Normally, you should
  8. /// not call an IRpcChannel directly, but instead construct a stub wrapping it.
  9. /// Generated service classes contain a CreateStub method for precisely this purpose.
  10. /// </summary>
  11. public interface IRpcChannel {
  12. /// <summary>
  13. /// Calls the given method of the remote service. This method is similar
  14. /// to <see cref="IService.CallMethod" /> with one important difference: the
  15. /// caller decides the types of the IMessage objects, not the implementation.
  16. /// The request may be of any type as long as <c>request.Descriptor == method.InputType</c>.
  17. /// The response passed to the callback will be of the same type as
  18. /// <paramref name="responsePrototype"/> (which must be such that
  19. /// <c>responsePrototype.Descriptor == method.OutputType</c>).
  20. /// </summary>
  21. void CallMethod(MethodDescriptor method, IRpcController controller,
  22. IMessage request, IMessage responsePrototype, Action<IMessage> done);
  23. }
  24. }