X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=acceptor.h;h=caa46474ce48d83185244cc2e977c155ce882e1b;hp=97672338a133b0006b9203a8e33903057dd0aa33;hb=684496ba9c7def1421d045435b6b92e80bc54c74;hpb=e1722a5c0341fd541ce57f1eed4dc76cbd3efe07 diff --git a/acceptor.h b/acceptor.h index 9767233..caa4647 100644 --- a/acceptor.h +++ b/acceptor.h @@ -5,16 +5,24 @@ int create_server_socket(int port); +class AcceptorProto; + // A thread that accepts new connections on a given socket, // and hands them off to the server pool. -class AcceptorThread : public Thread { +class Acceptor : public Thread { public: - AcceptorThread(int server_sock); + Acceptor(int server_sock, int port); + + // Serialization/deserialization. + Acceptor(const AcceptorProto &serialized); + AcceptorProto serialize() const; + + void close_socket(); private: virtual void do_work(); - int server_sock; + int server_sock, port; }; #endif // !defined(_ACCEPTOR_H)