+ Acceptor(int server_sock, const sockaddr_in6 &addr,
+ const std::string &certificate_chain, const std::string &private_key);
+
+ // Serialization/deserialization.
+ Acceptor(const AcceptorProto &serialized);
+ AcceptorProto serialize() const;
+
+ bool is_tls() const { return !certificate_chain.empty(); }
+
+ std::string get_certificate_chain() const {
+ assert(is_tls());
+ return certificate_chain;
+ }
+
+ std::string get_private_key() const {
+ assert(is_tls());
+ return private_key;
+ }
+
+ void close_socket();