26 Oct
2005
26 Oct
'05
6:23 p.m.
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 ) ); } }