Page 1 of 1

Session bindings using RCF 2.0

Posted: Tue Mar 26, 2013 3:23 pm
by Raider
How to migrate this code from to use with RCF 2.0?

Code: Select all

		RCF::SessionObjectFactoryServicePtr Factory(new RCF::SessionObjectFactoryService());
		Factory->bind<DatabaseService, CServerImpl>();
		Server->addService(Factory);
The point is to have separate CServerImpl objects for each connection to store/manage data for each connection. Server is using thread pools.

Re: Session bindings using RCF 2.0

Posted: Tue Mar 26, 2013 4:29 pm
by spino
server side:

Code: Select all

Server.getSessionObjectFactoryServicePtr()->bind<DatabaseService,CServerImpl>();
client side:

Code: Select all

Client.getClientStub().createRemoteSessionObject();

Re: Session bindings using RCF 2.0

Posted: Tue Mar 26, 2013 11:41 pm
by jarl
That is correct Spino.

SessionObjectFactoryService is deprecated in 2.0, and will eventually be dropped in future versions. In RCF 2.0, you should use RcfSession::createSessionObject<>() etc, to keep track of per-connection state. See this section in the user guide for more information:

http://www.deltavsoft.com/doc/rcf_user_ ... r_sessions