Hi
When use createCallbackConnection() API, there are 2 TCP connection.
I want to check connections wether the first connection is connected (or in an errornous situation) or disconnected.
When I use client->getClientStub().isConnected(), I guess it is only available to check 2nd connection.
Is there way to check 1st connection?
Regard
Mr Lim.
// Client-side
int main()
{
RCF::RcfInitDeinit rcfInit;
// Client needs a RcfServer to accept callback connections.
RCF::RcfServer callbackServer(( RCF::TcpEndpoint() ));
HelloWorldImpl helloWorld;
callbackServer.bind<I_HelloWorld>(helloWorld);
callbackServer.start();
// Establish client connection to server.
RcfClient<I_HelloWorld> client( RCF::TcpEndpoint(50001) );
// Create the callback connection.
RCF::createCallbackConnection(client, callbackServer);
// Server can now call Print() on the helloWorld object.
// ...
return 0;
}
question about connection check
Re: question about connection check
if you need more detail description, please let me know.
Re: question about connection check
From the server, you can only send pings on the second connection. The first connection is controlled by the client, so the server cannot ping it.
If you need to know on the server-side that the first connection is up, you'll need to implement that at the application level, by sending a message on the second connection instructing the client to ping the first connection.
If you need to know on the server-side that the first connection is up, you'll need to implement that at the application level, by sending a message on the second connection instructing the client to ping the first connection.