W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2002

Why does this not work?

From: Michael Labhard <ince@pacifier.com>
Date: Tue, 30 Apr 2002 16:35:46 -0700
Message-ID: <000a01c1f09f$c5250ad0$0f64adcf@homeke6pijupjp>
To: <www-lib@w3.org>
This class, when used to send more than 6 sets of data on my machine results
in a core dump using Windows XP Pro and cygwin.

#include <xmlrpc.h>
#include <xmlrpc_client.h>

#define NAME "Test"
#define VERSION "0.1"

class BadXmlRpc
{
 public:
    BadXmlRpc()
    {
        ::xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, NAME, VERSION);
    };
    ~BadXmlRpc()
    {
        ::xmlrpc_client_event_loop_end();
        ::xmlrpc_client_cleanup();
    }
    void SendData(char *data)
    {
        ::xmlrpc_client_call_asynch( http://localhost:8080:/RPC2,
"mymethod", 0, "(s)", data);
        ::xmlrpc_client_event_loop_finish_asynch_timeout( 200 );
    }
}

But this class works:

class GoodXmlRpc
{
public:
    void SendData(char *data)
    {
        ::xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, NAME, VERSION);

        ::xmlrpc_client_call_asynch( http://localhost:8080:/RPC2,
"mymethod", 0, "(s)", data);
        ::xmlrpc_client_event_loop_finish_asynch_timeout( 200 );

        ::xmlrpc_client_event_loop_end();
        ::xmlrpc_client_cleanup();
    }
}

Why cannot the initializtion and cleanup occur once for multiple asynch
calls and event loops?

-- Michael
Received on Tuesday, 30 April 2002 19:35:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:41 GMT