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