fixed huge bug and many fixes in new async client

nothing worked anymore. so I had to learn git bisect.
This also include  some code to only listen to a specifiec interface. This brings a problem if someone wants to listen on all interface. how to specify it? opc.tcp://*:4841 ? Is there a standard?
Should we also resolve host name in the same method?

I do not know reverse_lock. Any pointer?
On Sep 3, 2014 9:35 PM, "Alexander Rykovanov" <notifications@github.com>
wrote:

> In src/client/binary_server.cpp:
>
> >            std::unique_lock<std::mutex> lock(Mutex);
> >            Condition.wait(lock, [&]() { return (StopRequest == true) || (Queue.size() > 0) ;} );
> >            if (StopRequest)
> >            {
> >              return;
> >            }
> > -          Queue.front()();
> > -          Queue.pop();
> > +          while ( Queue.size() > 0 ) //to avoid crashing on spurious events
> > +          {
> > +            if (Debug)  { std::cout << "CallbackThread | condition has triggered copying callback and poping. queue size is  " << Queue.size() << std::endl; }
> > +            std::function<void()> callbackcopy = Queue.front();
> > +            Queue.pop();
> > +            lock.unlock();
>
> please use reverse_lock to avoid manual lock management.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/FreeOpcUa/freeopcua/pull/43/files#r17074168>.
>