divyang4481 / rcf-cpp

Automatically exported from code.google.com/p/rcf-cpp
0 stars 0 forks source link

Publishing large strings silently fails #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start with a pub/sub example, add a RCF method taking a string
2. Start the publisher & subscriber
2. Publish a huge string, 10000 chars works for me

What is the expected output? What do you see instead?
The method silently fails, does not throw. All other publish methods sent
after also silently fail. Sending a huge string over a normal remote call
doesn't seem to have this problem.

What version of the product are you using? On what operating system?
RCF 1.1, windows XP

Please provide any additional information below.

In case it matters, my test app is pretty much the same as the example in
your article:

    // PUBLISH

    // PropMaps always publish on the specified port. Will listen on all
network interfaces.
    RCF::TcpEndpoint endpoint( "0.0.0.0", port );
    m_svrPtr.reset( new RCF::RcfServer(endpoint) );
    m_pubSvcPtr.reset( new RCF::PublishingService() );

    m_svrPtr->addService(m_pubSvcPtr);
    m_svrPtr->start();

    // Start accepting subscription requests for I_Props.
    m_pubSvcPtr->beginPublish<I_Props>();

    // SUBSCRIBE
    RCF::TcpEndpoint endpoint( -1 );
    RcfServerPtr subSvrPtr( new RCF::RcfServer(endpoint));

    RCF::SubscriptionServicePtr subSvcPtr(
        new RCF::SubscriptionService() );

    subSvrPtr->addService( subSvcPtr );
    subSvrPtr->start();

    subSvcPtr->beginSubscribe<I_Props>( *this,
       RCF::TcpEndpoint(host, port) ); 

Original issue reported on code.google.com by arondan...@yahoo.com on 25 Sep 2009 at 2:22

GoogleCodeExporter commented 9 years ago
It sounds like the publisher is exceeding the max message length of the 
subscriber... On your subscribing RcfServer, add a line like this:

// Set max message size to 1 Mb.
subSvrPtr->getServerTransport().setMaxMessageLength(1024*1024); 

, before starting any subscriptions.

A RcfServer will terminate a connection that exceeds the max message length 
setting. 
That would be why the subsequent publishing calls are not making it through 
either.

Original comment by jarl.lin...@gmail.com on 29 Sep 2009 at 3:17

GoogleCodeExporter commented 9 years ago

Original comment by jarl.lin...@gmail.com on 14 Feb 2010 at 9:16