2017-08-08 18:43:25 +08:00
|
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2017-2018
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* AUTHOR(S)
|
|
|
|
|
* Zheng Shuxin
|
|
|
|
|
* E-mail: zhengshuxin@qiyi.com
|
|
|
|
|
*
|
|
|
|
|
* VERSION
|
|
|
|
|
* Tue 08 Aug 2017 01:57:39 PM CST
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
namespace acl
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class socket_stream;
|
|
|
|
|
class string;
|
|
|
|
|
|
2017-08-09 16:04:54 +08:00
|
|
|
|
/**
|
2017-08-09 16:15:01 +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>
|
2017-08-09 16:04:54 +08:00
|
|
|
|
*/
|
2017-08-08 23:27:37 +08:00
|
|
|
|
class ACL_CPP_API tcp_reader
|
2017-08-08 18:43:25 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
tcp_reader(socket_stream& conn);
|
|
|
|
|
~tcp_reader(void) {}
|
|
|
|
|
|
2017-08-09 16:04:54 +08:00
|
|
|
|
/**
|
2017-08-09 16:15:01 +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>
|
2017-08-09 16:04:54 +08:00
|
|
|
|
*/
|
2017-08-08 18:43:25 +08:00
|
|
|
|
bool read(string& out);
|
|
|
|
|
|
2017-08-09 19:05:38 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {acl::socket_stream&}
|
|
|
|
|
*/
|
|
|
|
|
acl::socket_stream& get_conn(void) const
|
|
|
|
|
{
|
|
|
|
|
return *conn_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-08 18:43:25 +08:00
|
|
|
|
private:
|
|
|
|
|
socket_stream* conn_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|