예제 #1
0
            public void send_Logout(LogoutRequest request)
            {
                oprot_.WriteMessageBegin(new TMessage("Logout", TMessageType.Call, seqid_));
                Logout_args args = new Logout_args();

                args.Request = request;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                oprot_.Transport.Flush();
            }
예제 #2
0
            public IAsyncResult send_Logout(AsyncCallback callback, object state, LogoutRequest request)
            {
                oprot_.WriteMessageBegin(new TMessage("Logout", TMessageType.Call, seqid_));
                Logout_args args = new Logout_args();

                args.Request = request;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                return(oprot_.Transport.BeginFlush(callback, state));
            }
예제 #3
0
            /// <summary>
            /// API 서버에게 로그아웃을 요청합니다.
            /// </summary>
            /// <param name="request"></param>
            public LogoutResponse Logout(LogoutRequest request)
            {
#if SILVERLIGHT
                var asyncResult = Begin_Logout(null, null, request);
                return(End_Logout(asyncResult));
#else
                send_Logout(request);
                return(recv_Logout());
#endif
            }
예제 #4
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 LogoutRequest();
                                await Request.ReadAsync(iprot, 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();
                }
            }
예제 #5
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 LogoutRequest();
                                Request.Read(iprot);
                            }
                            else
                            {
                                TProtocolUtil.Skip(iprot, field.Type);
                            }
                            break;

                        default:
                            TProtocolUtil.Skip(iprot, field.Type);
                            break;
                        }
                        iprot.ReadFieldEnd();
                    }
                    iprot.ReadStructEnd();
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
예제 #6
0
            public async Task <LogoutResponse> LogoutAsync(LogoutRequest request, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Logout", TMessageType.Call, SeqId), cancellationToken);

                var args = new LogoutArgs();

                args.Request = request;

                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 LogoutResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Logout failed: unknown result");
            }
예제 #7
0
 public IAsyncResult Begin_Logout(AsyncCallback callback, object state, LogoutRequest request)
 {
     return(send_Logout(callback, state, request));
 }