[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xmlblaster] Subscriber getting first message only - big clue!



I think I've located my problem.

I noticed that my subscriber in my main program is being disconnected
when the PUBLISHER in the same program logs out!

Here's some code:

    public void close()
    {
        if (open)
        {
            conn.disconnect(new DisconnectQos(global));
            open = false;
        }
    }

This method is called to close my publisher connection.  This connection
is created AFTER my subscriber gets the first message.  The Global in
this object is created like this:

    private static Global global = Global.instance();

So I thought that maybe the disconnect is killing BOTH connections.  So
I set a breakpoint on the disconnect call above, and inspected the
global object.  I found that the xmlBlasterAccess member of the global
has a "ME" variable which specifices the SUBSCRIBER I created earlier!
So I'm guessing that when I call disconnect here, that I'm disconnecting
the subscriber!

Maybe I need to understand Global better.  Is this a singleton?  If so,
how do I create many transient publishers and subscribers?  Am I only
allowed one connect from a single program?