]> git.sesse.net Git - cubemap/blob - acceptor.h
Move version identification into a common place.
[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 class AcceptorProto;
9
10 // A thread that accepts new connections on a given socket,
11 // and hands them off to the server pool.
12 class Acceptor : public Thread {
13 public:
14         Acceptor(int server_sock, int port);
15
16         // Serialization/deserialization.
17         Acceptor(const AcceptorProto &serialized);
18         AcceptorProto serialize() const;
19
20         void close_socket();
21
22 private:
23         virtual void do_work();
24
25         int server_sock, port;
26 };
27
28 #endif  // !defined(_ACCEPTOR_H)