예제 #1
0
void Table::sendToAll() {
    // TODO: Mutex lock?
    std::cout << "sending " << test << " to " << clients.length() << std::endl;
    Wt::WApplication *app = Wt::WApplication::instance();

    foreach(TableView* i, clients) {
        if (app && app->sessionId() == i->sessionId())
            i->updateNumber(test);
        else
            m_server.post(i->sessionId(), boost::bind(&TableView::updateNumber, i, test));
    }
}