#pragma once

class http_service;

class master_service : public acl::master_proc
{
public:
	master_service(void);
	~master_service(void);

	http_service& get_service(void) const;

public:
	/**
	 *  CGI ʽʱ
	 */
	void do_cgi(void);

protected:
	/**
	 * @override
	 * 麯յһͻʱô˺
	 * @param stream {aio_socket_stream*} ½յĿͻ첽
	 * עúغӽᱻرգûӦرո
	 */
	void on_accept(acl::socket_stream* stream);

	/**
	 * @override
	 * ڽʱÿɹһصַñ
	 * @param ss {acl::server_socket&} 
	 */
	void proc_on_listen(acl::server_socket& ss);

	/**
	 * @override
	 * лûݺõĻص˺ʱ
	 * ȨΪͨ޼
	 */
	void proc_on_init(void);

	/**
	 * @override
	 * ˳ǰõĻص
	 */
	void proc_on_exit(void);

	/**
	 * @override
	 * յ SIGHUP źźĻص
	 */
	bool proc_on_sighup(acl::string&);

private:
	http_service* service_;
};
