acl/lib_fiber/cpp/include/fiber/tcp_keeper.hpp
zsx 5bb7daf807 tcp_keeper: add ttl controling for connection and connections pools;
http_request/http_client add controling parameters
2018-12-29 15:42:03 +08:00

34 lines
529 B
C++

#pragma once
#include "fiber_cpp_define.hpp"
namespace acl {
class fiber_waiter;
class socket_stream;
class tcp_keeper : public thread
{
public:
tcp_keeper(void);
~tcp_keeper(void);
tcp_keeper& set_conn_timeout(int n);
tcp_keeper& set_rw_timeout(int n);
tcp_keeper& set_conn_max(int n);
tcp_keeper& set_conn_ttl(int ttl);
tcp_keeper& set_pool_ttl(int ttl);
socket_stream* peek(const char* addr);
void stop(void);
protected:
// @override
void* run(void);
private:
fiber_waiter* waiter_;
};
} // namespace acl