acl/lib_acl_cpp/include/acl_cpp/connpool/tcp_reader.hpp

39 lines
645 B
C++
Raw Normal View History

#pragma once
#include "../stdlib/noncopyable.hpp"
2018-12-12 11:16:12 +08:00
namespace acl
{
class socket_stream;
class string;
/**
* tcp ipc ͨ<EFBFBD>Ž<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>
2018-12-12 11:16:12 +08:00
*/
class ACL_CPP_API tcp_reader : public noncopyable
2018-12-12 11:16:12 +08:00
{
public:
tcp_reader(socket_stream& conn);
~tcp_reader(void) {}
/**
* <EFBFBD>ӶԶ˶<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ÿ<EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>
* @param out {string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׷<EFBFBD>ӷ<EFBFBD>ʽ<EFBFBD><EFBFBD> out <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2018-12-12 11:16:12 +08:00
*/
bool read(string& out);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2018-12-12 11:16:12 +08:00
* @return {acl::socket_stream&}
*/
acl::socket_stream& get_conn(void) const
{
return *conn_;
}
private:
socket_stream* conn_;
};
} // namespace acl