Factor all the common thread starting/stopping into a common Thread class.
[cubemap] / acceptor.h
1 #ifndef _ACCEPTOR_H
2 #define _ACCEPTOR_H
3
4 #include "thread.h"
5
6 int create_server_socket(int port);
7
8 // A thread that accepts new connections on a given socket,
9 // and hands them off to the server pool.
10 class AcceptorThread : public Thread {
11 public:
12         AcceptorThread(int server_sock);
13
14 private:
15         virtual void do_work();
16
17         int server_sock;
18 };
19
20 #endif  // !defined(_ACCEPTOR_H)