#pragma once

class mymonitor : public acl::connect_monitor
{
public:
	mymonitor(acl::connect_manager& manager, const acl::string& proto, bool check_server);
	~mymonitor(void);

protected:
	/**
	 * @override
	 *  connect_monitor 麯رһжϸǷǴ
	 * @param checker {check_client&} ӵļ󣬿ͨ
	 *  check_client еķ£
	 *  1) get_conn ÷Ӿ
	 *  2) get_addr ÷˵ַ
	 *  3) set_alive Ƿ
	 *  4) close ر
	 */
	void nio_check(acl::check_client& checker,
		acl::aio_socket_stream& conn);

	/**
	 * @override
	 * ͬ IO 麯ú̳߳صĳ߳̿ռУر
	 * ԼʵӦõӴ״̬ڱ IO 
	 * @param checker {check_client&} ӵļ
	 *  check_client õķ£
	 *  1) get_addr ÷˵ַ
	 *  2) set_alive Ƿ
	 *  check_client нֹõķ£
	 *  1) get_conn ÷Ӿ
	 *  2) close ر
	 */
	void sio_check(acl::check_client& checker, acl::socket_stream& conn);

	// @override
	void on_connected(const acl::check_client& checker, double cost);

	// @override
	void on_refuse(const char* addr, double cost);

	// @override
	void on_timeout(const char* addr, double cost);

private:
	acl::string proto_;
};
