Exemplo n.º 1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, MatrixBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_StartSession, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::Matrix.StartSessionRequest, global::Matrix.SessionEvent>(serviceImpl.StartSession));
     serviceBinder.AddMethod(__Method_GetAccessToken, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Matrix.GetAccessTokenRequest, global::Matrix.GetAccessTokenResponse>(serviceImpl.GetAccessToken));
     serviceBinder.AddMethod(__Method_JoinRoom, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Matrix.JoinRoomRequest, global::Matrix.JoinRoomResponse>(serviceImpl.JoinRoom));
     serviceBinder.AddMethod(__Method_Leave, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Matrix.LeaveRequest, global::Matrix.LeaveResponse>(serviceImpl.Leave));
     serviceBinder.AddMethod(__Method_SendTextMessage, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Matrix.SendTextMessageRequest, global::Matrix.SendTextMessageResponse>(serviceImpl.SendTextMessage));
     serviceBinder.AddMethod(__Method_SendReadReceipt, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Matrix.SendReadReceiptRequest, global::Matrix.SendReadReceiptResponse>(serviceImpl.SendReadReceipt));
 }
Exemplo n.º 2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(MatrixBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_StartSession, serviceImpl.StartSession)
            .AddMethod(__Method_GetAccessToken, serviceImpl.GetAccessToken)
            .AddMethod(__Method_JoinRoom, serviceImpl.JoinRoom)
            .AddMethod(__Method_Leave, serviceImpl.Leave)
            .AddMethod(__Method_SendTextMessage, serviceImpl.SendTextMessage)
            .AddMethod(__Method_SendReadReceipt, serviceImpl.SendReadReceipt).Build());
 }