public void recv_update()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                update_result result = new update_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                return;
            }
Esempio n. 2
0
            public void VideoCapture_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                VideoCapture_args args = new VideoCapture_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                VideoCapture_result result = new VideoCapture_result();

                try
                {
                    iface_.VideoCapture(args.Arguments);
                    oprot.WriteMessageBegin(new TMessage("VideoCapture", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("VideoCapture", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 3
0
            public async Task ShowInGameOverlay_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot)
            {
                ShowInGameOverlay_args args = new ShowInGameOverlay_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                ShowInGameOverlay_result result = new ShowInGameOverlay_result();

                try
                {
                    await iface_.ShowInGameOverlayAsync(args.Arguments);

                    oprot.WriteMessageBegin(new TMessage("ShowInGameOverlay", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("ShowInGameOverlay", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 4
0
            public void QueryQuestions_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                QueryQuestions_args args = new QueryQuestions_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                QueryQuestions_result result = new QueryQuestions_result();

                try
                {
                    result.Success = iface_.QueryQuestions(args.CourseId, args.TypeId, args.DiffType, args.PaperTypeId, args.KpId, args.CpId, args.PageIndex, args.PageSize);
                    oprot.WriteMessageBegin(new TMessage("QueryQuestions", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("QueryQuestions", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 5
0
            public void Blend_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                Blend_args args = new Blend_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                Blend_result result = new Blend_result();

                try
                {
                    result.Success = iface_.Blend(args.StartPosture, args.TargetPosture, args.Weight);
                    oprot.WriteMessageBegin(new TMessage("Blend", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("Blend", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 6
0
        public void helloworld(string who, Action <Exception, string> callback)
        {
            var ars = new AsyncRpcSessoin((ex) => {
                if (ex != null)
                {
                    callback(ex, default(string));
                    return(0);
                }
                helloworld_result result = new helloworld_result();
                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    callback(null, result.Success);
                }
                else
                {
                    callback(new TApplicationException(TApplicationException.ExceptionType.MissingResult, "helloworld failed: unknown result"), default(string));
                }
                return(0);
            }, -1);

            long sid = Rpc.Instance.AddNewSession(ars);

            oprot_.WriteMessageBegin(new TMessage("Tutorial:helloworld", TMessageType.Call, sid));
            helloworld_args args = new helloworld_args();

            args.Who = who;
            args.Write(oprot_);
            oprot_.WriteMessageEnd();
            oprot_.Transport.ServiceName = service_name_;
            oprot_.Transport.Flush();
        }
Esempio n. 7
0
        public void execute_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            execute_args args = new execute_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            execute_result result = new execute_result();

            try
            {
                result.Success = iface_.execute(args.FunctionName, args.FuncArgs);
            }
            catch (DRPCExecutionException e)
            {
                result.E = e;
            }
            catch (AuthorizationException aze)
            {
                result.Aze = aze;
            }
            oprot.WriteMessageBegin(new TMessage("execute", TMessageType.Reply, seqid));
            result.Write(oprot);
            oprot.WriteMessageEnd();
            oprot.Transport.Flush();
        }
 public bool Process(TProtocol iprot, TProtocol oprot)
 {
     try
     {
         TMessage        msg = iprot.ReadMessageBegin();
         ProcessFunction fn;
         processMap_.TryGetValue(msg.Name, out fn);
         if (fn == null)
         {
             TProtocolUtil.Skip(iprot, TType.Struct);
             iprot.ReadMessageEnd();
             TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'");
             oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));
             x.Write(oprot);
             oprot.WriteMessageEnd();
             oprot.Transport.Flush();
             return(true);
         }
         fn(msg.SeqID, iprot, oprot);
     }
     catch (IOException)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 9
0
            public void Revert_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                Revert_args args = new Revert_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                Revert_result result = new Revert_result();

                try
                {
                    result.Success = this.iface_.Revert(args.Image, args.Width, args.Height);
                    oprot.WriteMessageBegin(new TMessage("Revert", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("Revert", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
        protected IByteBuffer TryDecodeUnframedMessage(IChannelHandlerContext ctx,
                                                       IChannel channel,
                                                       IByteBuffer buffer,
                                                       TProtocolFactory inputProtocolFactory)
        {
            // Perform a trial decode, skipping through
            // the fields, to see whether we have an entire message available.

            int messageLength           = 0;
            int messageStartReaderIndex = buffer.ReaderIndex;

            try
            {
                using (TThriftTransport decodeAttemptTransport = new TThriftTransport(channel, buffer, ThriftTransportType.Unframed))
                {
                    int initialReadBytes = decodeAttemptTransport.GetReadByteCount();
                    using (TProtocol inputProtocol =
                               inputProtocolFactory.GetProtocol(decodeAttemptTransport))
                    {
                        // Skip through the message
                        inputProtocol.ReadMessageBegin();
                        TProtocolUtil.Skip(inputProtocol, TType.Struct);
                        inputProtocol.ReadMessageEnd();

                        messageLength = decodeAttemptTransport.GetReadByteCount() - initialReadBytes;
                    }
                }
            }
            catch (IndexOutOfRangeException)
            {
                // No complete message was decoded: ran out of bytes
                return(null);
            }
            catch (TTransportException)
            {
                // No complete message was decoded: ran out of bytes
                return(null);
            }
            finally
            {
                if (buffer.ReaderIndex - messageStartReaderIndex > this._opts.MaxFrameSize)
                {
                    ctx.FireExceptionCaught(new TooLongFrameException("Maximum frame size of " + this._opts.MaxFrameSize + " exceeded"));
                }

                buffer.SetReaderIndex(messageStartReaderIndex);
            }

            if (messageLength <= 0)
            {
                return(null);
            }

            // We have a full message in the read buffer, slice it off
            IByteBuffer messageBuffer =
                ExtractFrame(buffer, messageStartReaderIndex, messageLength);

            buffer.SetReaderIndex(messageStartReaderIndex + messageLength);
            return(messageBuffer);
        }
Esempio n. 11
0
            public void Say_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                Say_args args = new Say_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                Say_result result = new Say_result();

                try
                {
                    result.Success = iface_.Say(args.Command);
                    oprot.WriteMessageBegin(new TMessage("Say", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("Say", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 12
0
            public async Task GetLocalPath_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot)
            {
                GetLocalPath_args args = new GetLocalPath_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                GetLocalPath_result result = new GetLocalPath_result();

                try
                {
                    result.Success = await iface_.GetLocalPathAsync(args.Message);

                    oprot.WriteMessageBegin(new TMessage("GetLocalPath", TMessageType.Reply, seqid));
                    result.Write(oprot);
                }
                catch (TTransportException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine("Error occurred in processor:");
                    Console.Error.WriteLine(ex.ToString());
                    TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                    oprot.WriteMessageBegin(new TMessage("GetLocalPath", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Esempio n. 13
0
            public void updateRides_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                updateRides_args args = new updateRides_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                iface_.updateRides(args.Rides);
                return;
            }
Esempio n. 14
0
            public void PrintString_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                PrintString_args args = new PrintString_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                iface_.PrintString(args.Str);
                return;
            }
Esempio n. 15
0
            public void signout_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                signout_args args = new signout_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                iface_.signout(args.SessionId);
                return;
            }
Esempio n. 16
0
        public void zip_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            zip_args args = new zip_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            iface_.zip();
            return;
        }
Esempio n. 17
0
            public void sendAsync_0_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                sendAsync_0_args args = new sendAsync_0_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                iface_.sendAsync_0(args.Request);
                return;
            }
Esempio n. 18
0
        public void log_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            log_args args = new log_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            iface_.log(args.LstLogInfo);
            return;
        }
Esempio n. 19
0
        public void append_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            append_args args = new append_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            iface_.append(args.Evt);
            return;
        }
Esempio n. 20
0
            public void doPush_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                doPush_args args = new doPush_args();

                args.Read(iprot);
                iprot.ReadMessageEnd();
                iface_.doPush();
                return;
            }
Esempio n. 21
0
            public List <SavariWala.MapPoint> recv_getMapPoint()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                getMapPoint_result result = new getMapPoint_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getMapPoint failed: unknown result");
            }
Esempio n. 22
0
            public string recv_notify()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                notify_result result = new notify_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "notify failed: unknown result");
            }
Esempio n. 23
0
            public List <User> recv_GetAll()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                GetAll_result result = new GetAll_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetAll failed: unknown result");
            }
        public void recv_notify()
        {
            TMessage msg = iprot_.ReadMessageBegin();

            if (msg.Type == TMessageType.Exception)
            {
                TApplicationException x = TApplicationException.Read(iprot_);
                iprot_.ReadMessageEnd();
                throw x;
            }
            notify_result result = new notify_result();

            result.Read(iprot_);
            iprot_.ReadMessageEnd();
            if (result.__isset.e)
            {
                throw result.E;
            }
            return;
        }
Esempio n. 25
0
            public bool recv_isStarted()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                isStarted_result result = new isStarted_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "isStarted failed: unknown result");
            }
Esempio n. 26
0
            public void recv_beginServiceDelivery()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                beginServiceDelivery_result result = new beginServiceDelivery_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.Err != null)
                {
                    throw result.Err;
                }
                return;
            }
Esempio n. 27
0
            public Ruyi.SDK.StorageLayer.GetLocalPathResult recv_GetLocalPath()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                GetLocalPath_result result = new GetLocalPath_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetLocalPath failed: unknown result");
            }
Esempio n. 28
0
            public int recv_SendMsg()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                SendMsg_result result = new SendMsg_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendMsg failed: unknown result");
            }
Esempio n. 29
0
            public RestResponse recv_execute()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                var result = new execute_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "execute failed: unknown result");
            }
Esempio n. 30
0
            public CPopulationFitness recv_calculateXorPopulationFitness()
            {
                TMessage msg = iprot_.ReadMessageBegin();

                if (msg.Type == TMessageType.Exception)
                {
                    TApplicationException x = TApplicationException.Read(iprot_);
                    iprot_.ReadMessageEnd();
                    throw x;
                }
                calculateXorPopulationFitness_result result = new calculateXorPopulationFitness_result();

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculateXorPopulationFitness failed: unknown result");
            }