+Acceptor::Acceptor(const AcceptorProto &serialized)
+ : server_sock(serialized.server_sock()),
+ port(serialized.port())
+{
+}
+
+AcceptorProto Acceptor::serialize() const
+{
+ AcceptorProto serialized;
+ serialized.set_server_sock(server_sock);
+ serialized.set_port(port);
+ return serialized;
+}
+
+void Acceptor::close_socket()
+{
+ int ret;
+ do {
+ ret = close(server_sock);
+ } while (ret == -1 && errno == EINTR);
+
+ if (ret == -1) {
+ perror("close");
+ }
+}
+
+void Acceptor::do_work()