void PublishingService::addSubscriberTransport( RcfSession &rcfSession, const std::string &publisherName, ClientTransportAutoPtrPtr clientTransportAutoPtrPtr) { PublisherPtr publisherPtr; { Lock lock(mPublishersMutex); if ( mPublishers.find(publisherName) != mPublishers.end() ) { publisherPtr = mPublishers[publisherName].lock(); } } if ( publisherPtr ) { AsioNetworkSession& networkSession = static_cast<AsioNetworkSession&>(rcfSession.getNetworkSession()); // For now we assume the presence of wire filters indicates a HTTP/HTTPS connection. if ( networkSession.mWireFilters.size() > 0 ) { // This doesn't actually close anything, it just takes the session out of the server IO loop. rcfSession.setCloseSessionAfterWrite(true); (*clientTransportAutoPtrPtr)->setRcfSession(RcfSessionWeakPtr()); std::size_t wireFilterCount = networkSession.mWireFilters.size(); RCF_ASSERT(wireFilterCount == 1 || wireFilterCount == 2); RCF_UNUSED_VARIABLE(wireFilterCount); ConnectedClientTransport& connClientTransport = static_cast<ConnectedClientTransport&>(**clientTransportAutoPtrPtr); connClientTransport.setWireFilters(networkSession.mWireFilters); networkSession.mWireFilters.clear(); networkSession.setTransportFilters(std::vector<FilterPtr>()); } MulticastClientTransport &multicastClientTransport = static_cast<MulticastClientTransport &>( publisherPtr->mRcfClientPtr->getClientStub().getTransport()); multicastClientTransport.addTransport(*clientTransportAutoPtrPtr); } }
void FilterService::setTransportFilters( RcfSession &session, boost::shared_ptr<std::vector<FilterPtr> > filters) { session.getNetworkSession().setTransportFilters(*filters); }