コード例 #1
0
ファイル: BTransport.cs プロジェクト: ThomasEcherer/elo
        public void recv(BServer server, BMessage msg, BAsyncResultIF <BMessage> asyncResult)
        {
            if (log.isDebugEnabled())
            {
                log.debug("recv(");
            }

            BInput bin       = getInput(msg.header, msg.buf);
            Object methodObj = bin.load();

            if (log.isDebugEnabled())
            {
                log.debug("methodObj=" + methodObj);
            }

            MethodResult methodResult = new MethodResult(this, asyncResult, bin);

            BTargetId clientTargetId = bin.header.targetId;

            if (log.isDebugEnabled())
            {
                log.debug("clientTargetId=" + clientTargetId);
            }

            if (log.isDebugEnabled())
            {
                log.debug("server.recv");
            }
            server.recv(clientTargetId, methodObj, methodResult);

            if (log.isDebugEnabled())
            {
                log.debug(")recv");
            }
        }
コード例 #2
0
ファイル: BTransport.cs プロジェクト: ThomasEcherer/elo
            public void setAsyncResult(BMessage msg, Exception ex)
            {
                if (log.isDebugEnabled())
                {
                    log.debug("setAsyncResult(" + msg + ", ex=" + ex);
                }
                bool relogin = false;

                try
                {
                    if (ex != null)
                    {
                        // BYPS relogin error? (HTTP 401)
                        relogin = transport.internalIsReloginException(ex, transport.getObjectTypeId(methodRequest));
                        if (!relogin)
                        {
                            if (log.isDebugEnabled())
                            {
                                log.debug("return ex");
                            }
                            innerResult.setAsyncResult(default(T), ex);
                        }
                    }
                    else
                    {
                        if (log.isDebugEnabled())
                        {
                            log.debug("obj <- message");
                        }
                        BInput bin = transport.getInput(msg.header, msg.buf);
                        T      obj = (T)bin.load();

                        if (log.isDebugEnabled())
                        {
                            log.debug("return obj=" + obj);
                        }
                        innerResult.setAsyncResult(obj, null);
                    }
                }
                catch (Exception e)
                {
                    if (log.isDebugEnabled())
                    {
                        log.debug("exception=" + e);
                    }
                    try
                    {
                        relogin = transport.internalIsReloginException(e, transport.getObjectTypeId(methodRequest));
                    }
                    catch (Exception ignored) {
                        if (log.isDebugEnabled())
                        {
                            log.debug("ignored exception=", ignored);
                        }
                    }

                    if (!relogin)
                    {
                        if (log.isDebugEnabled())
                        {
                            log.debug("return ex");
                        }
                        innerResult.setAsyncResult(default(T), e);
                    }
                }

                if (log.isDebugEnabled())
                {
                    log.debug("relogin="******")setAsyncResult");
                }
            }