2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2019-05-09 13:57:51 +08:00
|
|
|
|
#include "../stdlib/noncopyable.hpp"
|
2018-12-12 11:16:12 +08:00
|
|
|
|
|
|
|
|
|
namespace acl
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class socket_stream;
|
|
|
|
|
class string;
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 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
|
|
|
|
*/
|
2019-05-09 13:57:51 +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) {}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <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);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <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
|