Disconnect Service

Hello,

I think there is a problem with the method disconnect of ServiceRequester. When I call this method on a ServiceRequester, the operationCaller is always ready.

I think the problem come from the equality methode of the OperationCaller.

OperationCaller& operator=(boost::shared_ptr<base::DisposableInterface> implementation)

        {
            if (this->impl && this->impl == implementation)
                return *this;
            OperationCaller0 tmp(implementation);
            //if (tmp.ready())  //I comment this line
                *this = tmp;
            return *this;
        }
When the method disconnect is called, this operator is use to put the new implementation, but the new implementation are not ready than this implementation can not be assign. I commented the line tmp.ready() and the problem is solved but I don't know if it's a good solution.

I have another question. Is it possible to disconnect (ready return false) an operationCaller without set another implementation?

I'm working with the master. Thanks

Disconnect Service

On Monday 06 December 2010 19:13:56 ookki [..] ... wrote:
> Hello,
>
>
> I think there is a problem with the method disconnect of ServiceRequester.
> When I call this method on a ServiceRequester, the operationCaller is
> always ready.
>
> I think the problem come from the equality methode of the OperationCaller.
>
> OperationCaller& operator=(boost::shared_ptr<base::DisposableInterface>
> implementation) {
> if (this->impl && this->impl == implementation)
> return *this;
> OperationCaller<Signature> tmp(implementation);
> //if (tmp.ready()) //I comment this line
> *this = tmp;
> return *this;
> }
> When the method disconnect is called, this operator is use to put the new
> implementation, but the new implementation are not ready than this
> implementation can not be assign. I commented the line tmp.ready() and the
> problem is solved but I don't know if it's a good solution.
>
> I have another question. Is it possible to disconnect (ready return false)
> an operationCaller without set another implementation?
>
> I'm working with the master.

Thanks for spotting this. I believe the best way would be to add a
disconnect() method to the OperationCaller that resets the implementation
internally.

In addition, I think that the if (tmp.ready()) call must indeed be omitted.
Otherwise, there's no means to inspect the result of the operator= function.

So your fix is correct, and we need another function for clarity.

Peter

Disconnect Service

On Monday 06 December 2010 23:02:48 Peter Soetens wrote:
> On Monday 06 December 2010 19:13:56 ookki [..] ... wrote:
> > Hello,
> >
> >
> > I think there is a problem with the method disconnect of
> > ServiceRequester. When I call this method on a ServiceRequester, the
> > operationCaller is always ready.
> >
> > I think the problem come from the equality methode of the
> > OperationCaller.
> >
> > OperationCaller& operator=(boost::shared_ptr<base::DisposableInterface>
> > implementation) {
> >
> > if (this->impl && this->impl == implementation)
> >
> > return *this;
> >
> > OperationCaller<Signature> tmp(implementation);
> > //if (tmp.ready()) //I comment this line
> >
> > *this = tmp;
> >
> > return *this;
> >
> > }
> >
> > When the method disconnect is called, this operator is use to put the new
> > implementation, but the new implementation are not ready than this
> > implementation can not be assign. I commented the line tmp.ready() and
> > the problem is solved but I don't know if it's a good solution.
> >
> > I have another question. Is it possible to disconnect (ready return
> > false) an operationCaller without set another implementation?
> >
> > I'm working with the master.
>
> Thanks for spotting this. I believe the best way would be to add a
> disconnect() method to the OperationCaller that resets the implementation
> internally.
>
> In addition, I think that the if (tmp.ready()) call must indeed be omitted.
> Otherwise, there's no means to inspect the result of the operator=
> function.
>
> So your fix is correct, and we need another function for clarity.

While trying to fix this, I noticed that the operation caller's CORBA proxy
code is still not correct either.

The patch in attachment fixes operator=(), adds the disconnect() call and fixes
disconnecting proxies.

Peter

Thanks for your fast answer.

Thanks for your fast answer.

Thanks for your fast answer.

Thanks for your fast answer.

Disconnect Service

Hello,

I think there is a problem with the method disconnect of ServiceRequester. When I call this method on a ServiceRequester, the operationCaller is always ready.

I think the problem come from the equality methode of the OperationCaller.

OperationCaller& operator=(boost::shared_ptr<base::DisposableInterface> implementation)
{
if (this->impl && this->impl == implementation)
return *this;
OperationCaller<Signature> tmp(implementation);
//if (tmp.ready()) //I comment this line
*this = tmp;
return *this;
}
When the method disconnect is called, this operator is use to put the new implementation, but the new implementation are not ready than this implementation can not be assign. I commented the line tmp.ready() and the problem is solved but I don't know if it's a good solution.

I have another question. Is it possible to disconnect (ready return false) an operationCaller without set another implementation?

I'm working with the master.
Thanks