完善代码

This commit is contained in:
xiongziliang 2018-09-27 16:08:24 +08:00
parent b1951cc3c9
commit 53a65f9592

View File

@ -94,21 +94,21 @@ public:
//收到eof或其他导致脱离TcpServer事件的回调 //收到eof或其他导致脱离TcpServer事件的回调
void onError(const SockException &err) override{ void onError(const SockException &err) override{
HttpSession::onError(err); HttpSessionType::onError(err);
if(_session){ if(_session){
_session->onError(err); _session->onError(err);
} }
} }
//每隔一段时间触发,用来做超时管理 //每隔一段时间触发,用来做超时管理
void onManager() override{ void onManager() override{
HttpSession::onManager(); HttpSessionType::onManager();
if(_session){ if(_session){
_session->onManager(); _session->onManager();
} }
} }
void attachServer(const TcpServer &server) override{ void attachServer(const TcpServer &server) override{
HttpSession::attachServer(server); HttpSessionType::attachServer(server);
_weakServer = const_cast<TcpServer &>(server).shared_from_this(); _weakServer = const_cast<TcpServer &>(server).shared_from_this();
} }
protected: protected:
@ -272,7 +272,9 @@ public:
}; };
typedef WebSocketSession<EchoSession> EchoWebSocketSession; typedef WebSocketSession<EchoSession,HttpSession> EchoWebSocketSession;
typedef WebSocketSession<EchoSession,HttpsSession> SSLEchoWebSocketSession;
} /* namespace Http */ } /* namespace Http */
} /* namespace ZL */ } /* namespace ZL */