Code: Select all
// Server-side - taking control of callback connections.
RCF::Mutex gCallbackClientMapMutex;
typedef RcfClient<I_HelloWorld> HelloWorldClient;
typedef boost::shared_ptr<HelloWorldClient> HelloWorldClientPtr;
std::map<std::string, HelloWorldClientPtr> gCallbackClientMap;
void onCallbackConnectionCreated(
RCF::RcfSessionPtr sessionPtr,
RCF::ClientTransportAutoPtr clientTransportPtr)
{
std::string & clientName = sessionPtr->getSessionObject<std::string>();
// Store the callback client transport in a global variable for later use.
RCF::Lock lock(gCallbackClientMapMutex);
HelloWorldClientPtr hwClientPtr( new HelloWorldClient(clientTransportPtr) );
gCallbackClientMap[clientName] = hwClientPtr;
}
Remove item from gCallbackClientMap ?