we have an issue with the creation of callback connections as documented in http://www.deltavsoft.com/doc/rcf_user_ ... onnections.
We are working currently with version RCF 2.0.0.2685.
The callback connection makes it possible that a client can be called by the server when a connection from the client to server was established before. This works so far.
But the server and client applications uses two established connections if an additional RcfClient object is made. I have initially thought that the callback connection also uses the already established connection.
So an existing RcfClient with an established connection should be used to create callback connections. The User Guide based code
Code: Select all
// Client-side - start a callback server.
RCF::RcfServer callbackServer( RCF::TcpEndpoint(0) );
HelloWorldImpl helloWorldImpl;
callbackServer.bind<I_HelloWorld>(helloWorldImpl);
callbackServer.start();
//Client-side additional code
RcfClient<SomeInterface_Rcf> alreadyExistingClient(( RCF::TcpEndpoint(port) ));
alreadyExistingClient.simpleCallToServer();
// Client-side - create callback connection.
RcfClient<I_HelloWorld> client(( RCF::TcpEndpoint(port) ));
RCF::createCallbackConnection(client, callbackServer);
alreadyExistingClient.simpleCallToServer();
Code: Select all
// Client-side - start a callback server.
RCF::RcfServer callbackServer( RCF::TcpEndpoint(0) );
HelloWorldImpl helloWorldImpl;
callbackServer.bind<I_HelloWorld>(helloWorldImpl);
callbackServer.start();
//Client-side additional code
RcfClient<SomeInterface_Rcf> alreadyExistingClient(( RCF::TcpEndpoint(port) ));
client.simpleCallToServer();
// Client-side - create callback connection.
RCF::createCallbackConnection(alreadyExistingClient, callbackServer);
alreadyExistingClient.simpleCallToServer(); //exception occurred here.
The problem was boiled down to a method in the file Marshal.cpp in the method createCallbackConnectionImpl:OS: 10038 - An operation was attempted on something that is not a socket.
Code: Select all
void createCallbackConnectionImpl(
ClientStub & clientStub,
ServerTransport & callbackServer)
{
RcfClient<I_CreateCallbackConnection> client(clientStub);
client.getClientStub().setTransport( clientStub.releaseTransport() );
client.CreateCallbackConnection();
convertRcfClientToRcfSession(client.getClientStub(), callbackServer);
}
Code: Select all
clientStub.setTransport(client.getClientStub().releaseTransport());
But maybe i have missed some point. I am not aware of possible side-effects with the additional statement in the file Marshal.cpp. And i have seen that in Rcf version 2.0.1 the Marshal.cpp method has changed and i have not tested this with this version. But at first look it seems to me that the problem is still there in version 2.0.1.
Kind regards
Falk