Example #1
0
 public HServerR(BTransport transport, BServer server, int nbOfConns)
     : base(transport, server)
 {
     this.nbOfConns = nbOfConns;
     this.sleepMillisBeforeRetry = 30 * 1000;
     //workerThread = new Thread(new ParameterizedThreadStart(workerFnct));
 }
Example #2
0
 public BInput(BTransport transport, BMessageHeader responseHeader, BRegistry registry)
 {
     this.header    = responseHeader;
     this.transport = transport;
     this.registry  = registry;
     this.idMap     = transport.getApiDesc().uniqueObjects ? null : new Dictionary <int, Object>();
 }
Example #3
0
 public override BOutput getResponse(BTransport transport, BMessageHeader requestHeader)
 {
     if (negotiatedByteOrder == ByteOrder.UNDEFINED)
     {
         throw new BException(BExceptionC.INTERNAL, "Protocol object can only be used for input.");
     }
     return(new BOutputS(transport, requestHeader));
 }
Example #4
0
 public override BOutput getOutput(BTransport transport)
 {
     if (negotiatedByteOrder == ByteOrder.UNDEFINED)
     {
         throw new BException(BExceptionC.INTERNAL, "Protocol object can only be used for input.");
     }
     return(new BOutputS(transport, negotiatedBypsVersion, negotiatedVersion, negotiatedByteOrder));
 }
Example #5
0
 public BOutput(BTransport transport, BRegistry registry, int streamHeaderMagic, int negotiatedBypsVersion, long negotiatedVersion, ByteOrder negotiatedByteOrder)
 {
     this.objMap           = transport.getApiDesc().uniqueObjects ? null : new BObjMap();
     this.header           = new BMessageHeader(streamHeaderMagic, negotiatedBypsVersion, negotiatedVersion, negotiatedByteOrder, transport.getWire().makeMessageId());
     this.header.targetId  = transport.getTargetId();
     this.header.sessionId = transport.getSessionId();
     this.transport        = transport;
     this.registry         = registry;
     this.streams          = null;
 }
Example #6
0
 public BOutput(BTransport transport, BRegistry registry, BMessageHeader requestHeader)
 {
     this.objMap           = transport.getApiDesc().uniqueObjects ? null : new BObjMap();
     this.header           = requestHeader;
     this.header.targetId  = transport.getTargetId();
     this.header.sessionId = transport.getSessionId();
     this.transport        = transport;
     this.registry         = registry;
     this.streams          = null;
 }
Example #7
0
        public BTransport(BTransport rhs, BTargetId targetId)
        {
            this.apiDesc   = rhs.apiDesc;
            this.wire      = rhs.wire;
            this.targetId  = targetId;
            this.sessionId = rhs.sessionId;
            this.protocol  = rhs.getProtocol();

            // Still connected to the server given by rhs.
            this.connectedServerId = rhs.targetId.getServerId();
        }
Example #8
0
            public void setAsyncResult(ByteBuffer buf, Exception ex)
            {
                if (log.isDebugEnabled())
                {
                    log.debug("setAsyncResult" + this + "(buf=" + buf + ", ex=" + ex);
                }
                if (Interlocked.Increment(ref isOpen) == 1)
                {
                    try
                    {
                        if (ex == null && buf != null && buf.remaining() != 0)
                        {
                            BMessageHeader header = new BMessageHeader();

                            bool nego = BNegotiate.isNegotiateMessage(buf);
                            if (nego)
                            {
                                BNegotiate negoResponse = new BNegotiate();
                                negoResponse.read(buf);

                                header.messageId = messageId;

                                BTransport utransport = wire.getClientUtilityRequests().getTransport();
                                utransport.applyNegotiate(negoResponse);
                            }
                            else
                            {
                                header.read(buf);
                            }

                            BMessage msg = buf != null ? new BMessage(header, buf, null) : null;
                            if (log.isDebugEnabled())
                            {
                                log.debug("asyncResult.set");
                            }
                            asyncResult.setAsyncResult(msg, ex);
                        }
                        else
                        {
                            asyncResult.setAsyncResult(null, ex);
                        }
                    }
                    catch (Exception e)
                    {
                        asyncResult.setAsyncResult(null, e);
                    }
                }
                if (log.isDebugEnabled())
                {
                    log.debug(")setAsyncResult");
                }
            }
Example #9
0
        public override Object read(Object obj, BInput bin1, long version)
        {
            BInputBin       bin      = ((BInputBin)bin1);
            BRemote         remote   = null;
            BTargetId       targetId = BTargetId.read(bin.bbuf.getBuffer(), bin1.header.bversion);
            BRemoteRegistry rreg     = bin.transport.getRemoteRegistry();

            if (rreg != null)
            {
                remote = rreg.getRemote(bin.header.targetId, targetId, typeId);
            }
            else
            {
                BTransport transport = new BTransport(bin.transport, targetId);
                remote = internalCreate(transport);
            }
            return(remote);
        }
Example #10
0
 public BInputS(BTransport transport, BMessageHeader responseHeader, ByteBuffer buf)
     : base(transport, responseHeader, buf, transport.getApiDesc().getRegistry(BBinaryModel.MEDIUM))
 {
 }
Example #11
0
 public abstract BOutput getResponse(BTransport transport, BMessageHeader requestHeader);
Example #12
0
 public abstract BInput getInput(BTransport transport, BMessageHeader responseHeader, ByteBuffer buf);
Example #13
0
 public MyAsyncResultRelogin(BTransport transport, BMethodRequest methodRequest, BAsyncResultIF <T> innerResult)
 {
     this.transport     = transport;
     this.methodRequest = methodRequest;
     this.innerResult   = innerResult;
 }
Example #14
0
 public abstract BOutput getOutput(BTransport transport);
Example #15
0
 public BOutputS(BTransport transport, BMessageHeader requestHeader)
     : base(transport, requestHeader)
 {
 }
Example #16
0
 public BOutputBin(BTransport transport, BMessageHeader requestHeader)
     : base(transport, transport.getApiDesc().getRegistry(BBinaryModel.MEDIUM), requestHeader)
 {
     this.bbuf = (BBufferBin)BBuffer.create(BBinaryModel.MEDIUM, null);
 }
Example #17
0
 public MyNegoAsyncResult(BTransport transport, BAsyncResultIF <bool> innerResult)
 {
     this.transport   = transport;
     this.innerResult = innerResult;
 }
Example #18
0
 public MethodResult(BTransport transport, BAsyncResultIF <BMessage> asyncResult, BInput bin)
 {
     this.transport   = transport;
     this.asyncResult = asyncResult;
     this.bin         = bin;
 }
Example #19
0
 protected virtual BRemote internalCreate(BTransport transport)
 {
     return(null);        // must be implemented by subclass
 }
Example #20
0
 public InternalAuthenticate_BAsyncResult(BTransport transport)
 {
     this.transport = transport;
 }
Example #21
0
 public BServer(BServer rhs)
 {
     this.transport = rhs.transport;
     this.clientR   = rhs.clientR;
     this.remotes   = rhs.remotes;
 }
Example #22
0
 public BServer(BTransport transport, BClient clientR)
 {
     this.transport = transport;
     this.clientR   = clientR;
     this.remotes   = new Dictionary <int, BRemote>();
 }
Example #23
0
 public override BInput getInput(BTransport transport, BMessageHeader responseHeader, ByteBuffer buf)
 {
     return(new BInputS(transport, responseHeader, buf));
 }
Example #24
0
 public BClient(BTransport transport, BServerR serverR)
 {
     this.transportVal = transport;
     this.serverR      = serverR;
     this.setAuthentication(null);
 }
Example #25
0
 public BInputBin(BTransport transport, BMessageHeader responseHeader, ByteBuffer buf, BRegistry registry)
     : base(transport, responseHeader, registry)
 {
     this.bbuf = (BBufferBin)BBuffer.create(BBinaryModel.MEDIUM, buf);
 }
Example #26
0
 public BOutputS(BTransport transport, int negotiatedBypsVersion, long negotiatedVersion, ByteOrder negotiatedByteOrder)
     : base(transport, BMessageHeader.MAGIC_BINARY_STREAM, negotiatedBypsVersion, negotiatedVersion, negotiatedByteOrder)
 {
 }
Example #27
0
 public BStub(BTransport transport)
 {
     this.transport = transport;
 }
Example #28
0
 public BServerR(BTransport transport, BServer server)
 {
     this.transport = transport;
     this.server    = new MyServer(this, server);
 }
Example #29
0
 public BOutputBin(BTransport transport, int streamHeaderMagic, int negotiatedBypsVersion, long negotiatedVersion, ByteOrder negotiatedByteOrder)
     : base(transport, transport.getApiDesc().getRegistry(BBinaryModel.MEDIUM), streamHeaderMagic, negotiatedBypsVersion, negotiatedVersion, negotiatedByteOrder)
 {
     this.bbuf = (BBufferBin)BBuffer.create(BBinaryModel.MEDIUM, null);
 }