Example #1
0
            public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    TField field;
                    await iprot.ReadStructBeginAsync(cancellationToken);

                    while (true)
                    {
                        field = await iprot.ReadFieldBeginAsync(cancellationToken);

                        if (field.Type == TType.Stop)
                        {
                            break;
                        }

                        switch (field.ID)
                        {
                        case 1:
                            if (field.Type == TType.Struct)
                            {
                                Request = new Ruyi.SDK.MediaService.RequestMsg();
                                await Request.ReadAsync(iprot, cancellationToken);
                            }
                            else
                            {
                                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                            }
                            break;

                        case 2:
                            if (field.Type == TType.Bool)
                            {
                                Broadcast = await iprot.ReadBoolAsync(cancellationToken);
                            }
                            else
                            {
                                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                            }
                            break;

                        default:
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                            break;
                        }

                        await iprot.ReadFieldEndAsync(cancellationToken);
                    }

                    await iprot.ReadStructEndAsync(cancellationToken);
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
Example #2
0
     public int SendMsg(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
     {
 #if SILVERLIGHT
         var asyncResult = Begin_SendMsg(null, null, request, broadcast);
         return(End_SendMsg(asyncResult));
 #else
         send_SendMsg(request, broadcast);
         return(recv_SendMsg());
 #endif
     }
Example #3
0
            public void send_SendMsg(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
            {
                oprot_.WriteMessageBegin(new TMessage("SendMsg", TMessageType.Call, seqid_));
                SendMsg_args args = new SendMsg_args();

                args.Request   = request;
                args.Broadcast = broadcast;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                oprot_.Transport.Flush();
            }
Example #4
0
            public IAsyncResult send_SendMsg(AsyncCallback callback, object state, Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
            {
                oprot_.WriteMessageBegin(new TMessage("SendMsg", TMessageType.Call, seqid_));
                SendMsg_args args = new SendMsg_args();

                args.Request   = request;
                args.Broadcast = broadcast;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                return(oprot_.Transport.BeginFlush(callback, state));
            }
Example #5
0
            public async Task <int> SendMsgAsync(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
            {
                int retval;

                retval = await Task.Run(() =>
                {
                    return(SendMsg(request, broadcast));
                });

                return(retval);
            }
Example #6
0
            public void Read(TProtocol iprot)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    TField field;
                    iprot.ReadStructBegin();
                    while (true)
                    {
                        field = iprot.ReadFieldBegin();
                        if (field.Type == TType.Stop)
                        {
                            break;
                        }
                        switch (field.ID)
                        {
                        case 1:
                            if (field.Type == TType.Struct)
                            {
                                Request = new Ruyi.SDK.MediaService.RequestMsg();
                                Request.Read(iprot);
                            }
                            else
                            {
                                TProtocolUtil.Skip(iprot, field.Type);
                            }
                            break;

                        case 2:
                            if (field.Type == TType.Bool)
                            {
                                Broadcast = iprot.ReadBool();
                            }
                            else
                            {
                                TProtocolUtil.Skip(iprot, field.Type);
                            }
                            break;

                        default:
                            TProtocolUtil.Skip(iprot, field.Type);
                            break;
                        }
                        iprot.ReadFieldEnd();
                    }
                    iprot.ReadStructEnd();
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
Example #7
0
            public void send_SendMsg(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
      #endif
            {
                oprot_.WriteMessageBegin(new TMessage("SendMsg", TMessageType.Call, seqid_));
                SendMsg_args args = new SendMsg_args();

                args.Request   = request;
                args.Broadcast = broadcast;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
        #if SILVERLIGHT
                return(oprot_.Transport.BeginFlush(callback, state));
        #else
                oprot_.Transport.Flush();
        #endif
            }
Example #8
0
            public async Task <int> SendMsgAsync(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("SendMsg", TMessageType.Call, SeqId), cancellationToken);

                var args = new SendMsgArgs();

                args.Request   = request;
                args.Broadcast = broadcast;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new SendMsgResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendMsg failed: unknown result");
            }
Example #9
0
 public IAsyncResult Begin_SendMsg(AsyncCallback callback, object state, Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
 {
     return(send_SendMsg(callback, state, request, broadcast));
 }
Example #10
0
            public int SendMsg(Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)
            {
                var asyncResult = Begin_SendMsg(null, null, request, broadcast);

                return(End_SendMsg(asyncResult));
            }
Example #11
0
 public IAsyncResult send_SendMsg(AsyncCallback callback, object state, Ruyi.SDK.MediaService.RequestMsg request, bool broadcast)