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

[xmlblaster] problems in XmlBlasterAccess.cpp



Hi,
	
	C++ client disconnect to xmlblaster return false.
	I modify the PublishDemo.cpp in c++ demos, add a disconnect() method like this:
 	void disconnect()
    {
	   	bool bDis_;
	   	DisconnectQos disQos_(global_);
		try
		{
			bDis_ = connection_.disconnect (disQos_);
	        //bDis_ = connection_.disconnect (disQos_, true, false, true);
		}
		catch(...)
		{
			std::cout << "errors occur when disconnect" << std::endl;
		}
   	}
	and call this method after "demo.erase();" at line 124 in PublishDemo.cpp.
	
	But connection_.disconnect() method return false when program runs.
	After having read the src code of XmlBlasterAccess.cpp and CorbaConnection.cpp,
	I find there are some problems:
    program runs to "ret1 = connection_->disconnect(qos);" at line 156 in XmlBlasterAccess.cpp, it will call shutdown() method at line 459 or line 464 in CorbaConnection.cpp, the method returns true.
	program runs to "if (shutdown) ret2 = connection_->shutdown();" at line 157, if shutdown flag is true, the shutdown() method in CorbaConnection will be revoked again, and this time, returns false, and results in the false return of disconnec() method in XmlBlasterAccess.
	
	In my option,the shutdown flag in XmlBlasterAccess::disconnect() method is useless, whether it is true or false, the shutdown() method in CorbaConnection.cpp will be revoked,isn't it?
	
regards	
	
	
pikaiyuan
pi_kyuan at cvicse.com
2003-09-13