1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

move QQtLocalServer to highgrade module

This commit is contained in:
tianduanrui 2018-07-13 08:29:23 +08:00
parent dd56058ab2
commit d6b7498cb2
8 changed files with 43 additions and 24 deletions

View File

@ -54,9 +54,9 @@ github link: https://github.com/AbelTian/LibQQt
- 通讯口类
- QQtNfcClient、QQtNfcServer 支持近场通讯。
- QQtSerialPort 兼容QSerialPort and QextSerialPort
- [QQtTcpClient](src/network/qqttcpclient.h)、QQtTcpServer、QQtUdpClient
- QQtBluetoothSocket +QQtBluetoothManager
- QQtWebAccessManager支持http、ftp等主流协议高并发传输。
- [QQtTcpClient](src/network/qqttcpclient.h)、QQtTcpServer、QQtUdpClient、QQtUdpServer
- QQtBluetoothSocket、QQtBluetoothServer +QQtBluetoothManager
- QQtWebAccessManager支持http、ftp等主流协议高并发传输管理cookie和session
- [QQtWebSocket](src/network/qqtwebsocketclient.h) 接口
- 协议虚类(接口类) [QQtProtocol](src/network/qqtprotocol.h) QQtWebSocketProtocol
- 报文虚类(接口类) [QQtMessage](src/network/qqtmessage.h)
@ -96,6 +96,11 @@ github link: https://github.com/AbelTian/LibQQt
8. 添加Qt没有的组件QQtTitleBar
- 可以组完全自定义的Form。
- 加上QQtOSDFrame可以组透明Form。
8. HighGrade增加新成员
- 线程间、进程间通信组件
- QQtSharedMemory实现可以跨线程的临时变量。
- QQtLocalServer QQtLocalClient 使用QLocalSocket实现跨线程通讯。(**HighGrade**)
- QQtSingleTonApplication 利用基于QLocalSocket的进程间通信实现。
========================================================================
# 多链接发布技术

View File

@ -42,7 +42,8 @@ public:
}
~QQtSharedMemory() {}
//需要重写,改变共享内存块大小。
virtual void initializer() {
//user set payload size.
//这个只需要调用一次但是调用多次也正常使用。我在这个教程父类里面给的是1024.子类可变可改。这个是最大约束,万万不能超过。
@ -50,7 +51,8 @@ public:
//这个每个变量都必须调用是这个函数保证data()指针有数的。
attach();
}
//需要重写,实现把局部变量打包到共享内存块。(注释部分。)
//这个函数保证写入共享内存。
virtual void packer() {
lock();
@ -69,6 +71,7 @@ public:
unlock();
}
//需要重写,实现把共享内存块解压到局部变量。(注释部分。)
//这个函数保证从共享内存读取。
virtual void parser() {
lock();
@ -82,6 +85,8 @@ public:
unlock();
}
/*以下函数提供操作方便。*/
QByteArray readShortString ( QByteArray& bytes ) {
quint16 s0;
QByteArray str;

View File

@ -257,9 +257,6 @@ defineTest(add_defines_QQt){
#raw socket, 这个是常用的不要关dont close。...
DEFINES += __TCPUDPSOCKET__
##################Local RawSocket Module###############################
DEFINES += __LOCALSOCKET__
##################WebService Module###############################
#if you use Qt Service Support ( QtSoap ), open this annotation
DEFINES += __WEBSERVICESUPPORT__
@ -400,7 +397,10 @@ defineTest(add_defines_QQt){
#高级模块,包含不少的高级功能组件,这个模块可以集中开关。
DEFINES += __HIGHGRADE__
contains (DEFINES, __HIGHGRADE__) {
##################Local RawSocket Module###############################
DEFINES += __LOCALSOCKET__
#local socket依赖network support
!contains(DEFINES, __NETWORKSUPPORT__):DEFINES-=__LOCALSOCKET__
}
#################################################################

View File

@ -279,17 +279,6 @@ contains (DEFINES, __NETWORKSUPPORT__) {
HEADERS += $$PWD/network/qqtudpserver.h
}
#local iodevice
contains(DEFINES, __LOCALSOCKET__){
#local client iodevice
SOURCES += $$PWD/network/qqtlocalclient.cpp
HEADERS += $$PWD/network/qqtlocalclient.h
#local server iodevice
SOURCES += $$PWD/network/qqtlocalserver.cpp
HEADERS += $$PWD/network/qqtlocalserver.h
}
#serialport iodevice
SOURCES += $$PWD/network/qqtserialport.cpp
HEADERS += $$PWD/network/qqtserialport.h
@ -570,20 +559,40 @@ contains (DEFINES, __EXQUISITE__) {
}
contains (DEFINES, __HIGHGRADE__) {
#system infomation
#use platform api?
SOURCES += \
$$PWD/highgrade/qqtsysteminfo.cpp
HEADERS += \
$$PWD/highgrade/qqtsysteminfo.h
#shared memory
#core module
SOURCES += \
$$PWD/highgrade/qqtsharedmemory.cpp
HEADERS += \
$$PWD/highgrade/qqtsharedmemory.h
SOURCES += \
$$PWD/highgrade/qqtsingleapplication.cpp
HEADERS += \
$$PWD/highgrade/qqtsingleapplication.h
#local socket iodevice
#network module
contains(DEFINES, __LOCALSOCKET__){
#local client iodevice
SOURCES += $$PWD/highgrade/qqtlocalclient.cpp
HEADERS += $$PWD/highgrade/qqtlocalclient.h
#local server iodevice
SOURCES += $$PWD/highgrade/qqtlocalserver.cpp
HEADERS += $$PWD/highgrade/qqtlocalserver.h
}
#singleton application
contains(DEFINES, __LOCALSOCKET__){
#依赖local socket
SOURCES += \
$$PWD/highgrade/qqtsingleapplication.cpp
HEADERS += \
$$PWD/highgrade/qqtsingleapplication.h
}
}
include ($$PWD/qqt_3rdparty.pri)