mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
完善实例代码
This commit is contained in:
parent
21acda1e42
commit
223371ab5d
@ -308,9 +308,17 @@ private:
|
|||||||
*/
|
*/
|
||||||
class EchoSession : public TcpSession {
|
class EchoSession : public TcpSession {
|
||||||
public:
|
public:
|
||||||
EchoSession(const std::shared_ptr<ThreadPool> &pTh, const Socket::Ptr &pSock) : TcpSession(pTh,pSock){};
|
EchoSession(const std::shared_ptr<ThreadPool> &pTh, const Socket::Ptr &pSock) :
|
||||||
virtual ~EchoSession(){};
|
TcpSession(pTh,pSock){
|
||||||
|
DebugL;
|
||||||
|
}
|
||||||
|
virtual ~EchoSession(){
|
||||||
|
DebugL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void attachServer(const TcpServer &server) override{
|
||||||
|
DebugL << getIdentifier() << " " << TcpSession::getIdentifier();
|
||||||
|
}
|
||||||
void onRecv(const Buffer::Ptr &buffer) override {
|
void onRecv(const Buffer::Ptr &buffer) override {
|
||||||
send(buffer);
|
send(buffer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user