1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/examples/qqtnetworkexample/usertest3protocol.cpp
tianduanrui e3a0357214 update
2018-04-30 10:25:29 +08:00

28 lines
707 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "usertest3protocol.h"
QDebug& operator << ( QDebug& dbg, const UserTest3Message& msg )
{
//这里打印一下,报文里面到底有什么信息,
//一般到这里的都是被解析好的message。
dbg.nospace() << "{" << hex << msg.size() << "}";
return dbg.space();
}
UserTest3Protocol* UserTest3ConnectionInstance ( QObject* parent )
{
static UserTest3Protocol* p0 = NULL;
static QQtTcpServer* s0 = NULL;
if ( !p0 && !s0 )
{
p0 = new UserTest3Protocol ( parent );
s0 = new QQtTcpServer ( parent );
s0->installProtocol ( p0 );
s0->listen ( QHostAddress::Any, 8000 );
}
return p0;
}