コード例 #1
0
ファイル: ClientStub.cpp プロジェクト: tsingcoo/study
    void ClientStub::instantiateTransport()
    {
        CurrentClientStubSentry sentry(*this);
        if (!mTransport.get())
        {
            RCF_VERIFY(mEndpoint.get(), Exception(_RcfError_NoEndpoint()));
            mTransport.reset( mEndpoint->createClientTransport().release() );
            RCF_VERIFY(mTransport.get(), Exception(_RcfError_TransportCreation()));
        }

        if (    mAsync 
            &&  !mTransport->isAssociatedWithIoService())
        {
            RcfServer * preferred = getAsyncDispatcher();
            AsioIoService * pIoService = NULL;

            if (preferred)
            {
                ServerTransport & transport = preferred->getServerTransport();
                AsioServerTransport & asioTransport = dynamic_cast<AsioServerTransport &>(transport);
                pIoService = & asioTransport.getIoService();
            }
            else
            {
                pIoService = & getAmiThreadPool().getIoService();
            }

            mTransport->associateWithIoService(*pIoService);
        }
    }
コード例 #2
0
    void onServiceAddedProto(FilterService & fs, RcfServer & server)
    {
        boost::shared_ptr<FilterServicePb> fsPbPtr(
            new FilterServicePb(fs));

        server.bind((I_RequestTransportFiltersPb *) NULL, fsPbPtr);
    }
コード例 #3
0
    void onServiceAddedProto(SessionObjectFactoryService & sofs, RcfServer & server)
    {
        boost::shared_ptr<SessionObjectFactoryServicePb> sofsPbPtr(
            new SessionObjectFactoryServicePb(sofs));

        server.bind((I_SessionObjectFactoryPb *) NULL, sofsPbPtr);
    }
コード例 #4
0
    void onServiceAddedProto(ObjectFactoryService & ofs, RcfServer & server)
    {
        boost::shared_ptr<ObjectFactoryServicePb> ofsPbPtr( 
            new ObjectFactoryServicePb(ofs) );

        server.bind((I_ObjectFactoryPb *) NULL, ofsPbPtr);
    }
コード例 #5
0
    void ObjectFactoryService::onServerStart(RcfServer & server)
    {
        mTokenFactory.reset( new TokenFactory(server.getOfsMaxNumberOfObjects()) );
        mClientStubTimeoutS = server.getOfsObjectTimeoutS();
        mCleanupIntervalS = server.getOfsCleanupIntervalS();
        mCleanupThreshold = server.getOfsCleanupThreshold();

        RCF_ASSERT(0.0 <= mCleanupThreshold && mCleanupThreshold <= 1.0);

        // up-front initialization, before threads get into the picture
        typedef std::vector<Token>::const_iterator Iter;
        for (
            Iter iter = mTokenFactory->getTokenSpace().begin();
            iter != mTokenFactory->getTokenSpace().end();
            ++iter)
        {
            mStubMap[*iter].first.reset(new Mutex());
        }
    }
コード例 #6
0
    void ServerObjectService::onServerStart(RcfServer & server)
    {
        mpRcfServer = & server;

        mHarvestingIntervalS = server.getServerObjectHarvestingIntervalS();
        if (mHarvestingIntervalS)
        {
            mPeriodicTimer.setIntervalMs(1000*mHarvestingIntervalS);
            mPeriodicTimer.start();
        }
    }
コード例 #7
0
 bool UdpServerTransport::cycleTransportAndServer(
     RcfServer &server,
     int timeoutMs,
     const volatile bool &stopFlag)
 {
     if (!stopFlag && !mStopFlag)
     {
         cycle(timeoutMs/2, stopFlag);
         server.cycleSessions(timeoutMs/2, stopFlag);
     }
     return stopFlag || mStopFlag;
 }
コード例 #8
0
    void ObjectFactoryService::onServiceAdded(RcfServer &server)
    {
        server.bind((I_ObjectFactory *) NULL, *this);

        onServiceAddedProto(*this, server);

        mTaskEntries.clear();

        mTaskEntries.push_back(
            TaskEntry(
            boost::bind(&ObjectFactoryService::cycleCleanup, this, _1, _2),
            boost::bind(&ObjectFactoryService::stopCleanup, this),
            "RCF Ofs cleanup"));

        mStopFlag = false;
    }
コード例 #9
0
    void FilterService::onServiceAdded(RcfServer & server)
    {
        server.bind( (I_RequestTransportFilters *) NULL, *this);

        onServiceAddedProto(*this, server);
    }
コード例 #10
0
 void onServiceRemovedProto(FilterService & fs, RcfServer & server)
 {
     server.unbind( (I_RequestTransportFiltersPb *) NULL);
 }
コード例 #11
0
    void FilterService::onServiceRemoved(RcfServer & server)
    {
        server.unbind( (I_RequestTransportFilters *) NULL);

        onServiceRemovedProto(*this, server);
    }
コード例 #12
0
 void CallbackConnectionService::onServerStart(RcfServer & server)
 {
     mOnCallbackConnectionCreated = server.getOnCallbackConnectionCreated();
 }
コード例 #13
0
    void SessionObjectFactoryService::onServiceRemoved(RcfServer &server)
    {
        server.unbind( (I_SessionObjectFactory *) NULL);

        onServiceRemovedProto(*this, server);
    }
コード例 #14
0
    void SessionObjectFactoryService::onServiceAdded(RcfServer &server)
    {
        server.bind((I_SessionObjectFactory *) NULL, *this);

        onServiceAddedProto(*this, server);
    }
コード例 #15
0
 void onServiceRemovedProto(SessionObjectFactoryService & sofs, RcfServer & server)
 {
     server.unbind( (I_SessionObjectFactoryPb *) NULL);
 }
コード例 #16
0
 void onServiceRemovedProto(ObjectFactoryService &, RcfServer & server)
 {
     server.unbind( (I_ObjectFactoryPb *) NULL);
 }