-
Notifications
You must be signed in to change notification settings - Fork 0
/
TcpSocketServer.h
44 lines (38 loc) · 1003 Bytes
/
TcpSocketServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//#pragma once
#ifndef TEST_H
#define TEST_H
#include <QTcpServer>
#include <QObject>
#include <QDebug>
#include <QTcpSocket>
#include <QMap>
#include <queue>
#include <string>
#include <vector>
#include <iostream>
#include "dbProcess.h"
#include "Tcp_tools.h"
class TcpSocketServer:public QTcpServer//,public QObject
{
Q_OBJECT
public:
QMap<QString,QTcpSocket*> *tcp;//=new QMap<QString,QTcpSocket*>;//改成全局变量试一试
//QMap<QString,ip_port*> *socket_ip_port;//=new QMap<QString,ip_port*>;//存客户端的ip和port
TcpSocketServer();
virtual void incomingConnection(qintptr handle);
void show_map();
public slots:
void response_handle(processObject);
};
class ServerResponseThread : public QThread//,public QObject
{
Q_OBJECT
public:
ServerResponseThread();
ServerResponseThread(QMap<QString,QTcpSocket*>*);
virtual void run() override;
//QMap<QString,QTcpSocket*>* tcp2;
signals:
void db_response_signal(processObject);
};
#endif