|
Boost Users : |
Subject: Re: [Boost-users] Suggestion about using Signals2
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-23 06:15:11
> Just one last thing..
>
> I've tried to to something like this (where signal_OnData is a signal):
>
> void SerialPort::reading()
> {
> Â .... data available...
> Â //signal_OnData();
> Â _io.post( boost::bind(&SerialPort::Post_OnData, this) );
> }
>
> void SerialPort::Post_OnData()
> {
> Â signal_OnData();
> };
>
> but the SerialPort::Post_OnData is not called, is this my design wrong?
I guess that your io_service is not running, so noone processes its
queue. You have to call io_service::run function, it's kindof "message
loop" of io_service:
http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/tutorial/tutdaytime3.html
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net