Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-10-26 13:23:55


Peter Dimov wrote:

> Try something along the lines of:
>
> class DaemonThread
> {
> private:
>
> int cfd_;

[...]

... if you need a class for other reasons; remember that you can use a
function taking an argument:

void daemon_thread( int fd );

> void mainloop()
> {
> while( 1 )
> {
> int fd = accept();
          boost::thread th( boost::bind( daemon_thread, fd ) );
> }
> }


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