连接管理模块
更多...
#include <connection.hpp>
◆ ptr [1/2]
◆ ptr [2/2]
◆ Connection() [1/2]
XuMQ::Connection::Connection |
( |
const std::string & |
sip, |
|
|
int |
sport, |
|
|
const AsyncWorker::ptr & |
worker |
|
) |
| |
|
inline |
连接构造函数
- 参数
-
sip | 服务器ip |
sport | 服务器端口号 |
worker | 异步工作器句柄 |
◆ Connection() [2/2]
连接构造函数
- 参数
-
host | 虚拟机 |
cmp | 消费者管理句柄 |
codec | 协议处理句柄 |
conn | muduo连接管理句柄 |
pool | 线程池管理句柄 |
◆ basicRespFunc()
void XuMQ::Connection::basicRespFunc |
( |
bool |
ok, |
|
|
const std::string & |
rid, |
|
|
const std::string & |
cid |
|
) |
| |
|
inlineprivate |
◆ closeChannel() [1/2]
void XuMQ::Connection::closeChannel |
( |
const Channel::ptr & |
channel | ) |
|
|
inline |
◆ closeChannel() [2/2]
◆ commonResponse()
void XuMQ::Connection::commonResponse |
( |
const muduo::net::TcpConnectionPtr & |
conn, |
|
|
const basicResponsePtr |
message, |
|
|
muduo::Timestamp |
|
|
) |
| |
|
inlineprivate |
处理一般响应的回调函数
- 参数
-
conn | muduo连接 |
message | 响应句柄 |
时间戳 | |
◆ consumeResponse()
void XuMQ::Connection::consumeResponse |
( |
const muduo::net::TcpConnectionPtr & |
conn, |
|
|
const basicConsumeResponsePtr |
message, |
|
|
muduo::Timestamp |
|
|
) |
| |
|
inlineprivate |
处理消费响应的回调函数
- 参数
-
conn | muduo连接 |
message | 消费响应 |
时间戳 | |
◆ getChannel()
Channel::ptr XuMQ::Connection::getChannel |
( |
const std::string & |
cid | ) |
|
|
inline |
◆ onConnection()
void XuMQ::Connection::onConnection |
( |
const muduo::net::TcpConnectionPtr & |
conn | ) |
|
|
inlineprivate |
◆ onUnknowMessage()
void XuMQ::Connection::onUnknowMessage |
( |
const muduo::net::TcpConnectionPtr & |
conn, |
|
|
const MessagePtr & |
message, |
|
|
muduo::Timestamp |
|
|
) |
| |
|
inlineprivate |
未知响应回调函数
- 参数
-
conn | muduo连接 |
message | 未知响应 |
时间戳 | |
◆ openChannel() [1/2]
◆ openChannel() [2/2]
◆ _channels
◆ _client
muduo::net::TcpClient XuMQ::Connection::_client |
|
private |
◆ _cmp
◆ _codec
◆ _conn
muduo::net::TcpConnectionPtr XuMQ::Connection::_conn |
|
private |
◆ _dispatcher
ProtobufDispatcher XuMQ::Connection::_dispatcher |
|
private |
◆ _host
◆ _latch
muduo::CountDownLatch XuMQ::Connection::_latch |
|
private |
◆ _pool
◆ _worker