Hi All,

New here, learning C++ Done a little bit of C# and Java before, but this application has to be in C++

I found an application using the Qt framework for a TCP server, but since I have to dynamically link and include the frameworks/libraries, etc .. it seems to be a right mission, so I would like to convert it using boost.

basically, what it does, it listens for connections, accepts a connection and creates a new object for each connection (client). The clients then send in a plain text string to subscribe to a certain "object/class".

Anyway, in this class, there is a function that updates or gets call continuously (from another function) and if the new value is not equals the old value, it notifies the client (not all, but only the client(s) that subscribed)

Qt code looks like this:

Code:
void DoubleDataRef::updateValue(double newValue) {
    if(_value != newValue) {
        _value = newValue;
        if(!_valueValid) setValueValid();
        emit changed(this);
    }
}
In Qt, the signal/slot connects the client to this class function and when "emit changed(this)" is called, it writes the new value to the client/socket (I assume).

How would I be able to apply the same in boost ? I am just looking for someone to point me in the right direction ?

Can I just call a function if the value above have changed (instead of emit), that fire an async_write (_value) to the client socket ? Do I have to pass a pointer to the client socket in order for this class to know which client socket to write to ?

Thanks!