Adds q2 repos to migrate
This commit is contained in:
1 parent
ad1f62c4ee
commit
17f1c61c9e
991 files changed
+178451
No files matched your search
Executable
+96
@@ -0,0 +1,96 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QTcpServer>
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
|
||||
class WorkerInstance;
|
||||
class CommandInterface;
|
||||
|
||||
|
||||
|
||||
class TCPSERVER_EXPORT TcpServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef QVector<CommandInterface*(*)(unsigned short) > CommandInterfaceList;
|
||||
public:
|
||||
|
||||
|
||||
virtual ~TcpServer();
|
||||
|
||||
|
||||
static TcpServer *instance(unsigned short port);
|
||||
|
||||
|
||||
|
||||
bool listen(const QHostAddress &address = QHostAddress::Any);
|
||||
|
||||
|
||||
|
||||
void setUseWorkerThreads(bool bEnable);
|
||||
|
||||
|
||||
|
||||
bool useWorkerThreads() const;
|
||||
|
||||
|
||||
|
||||
QVector<WorkerInstance *> workers() const;
|
||||
|
||||
|
||||
|
||||
unsigned short getListenPort() const;
|
||||
|
||||
|
||||
|
||||
static bool registerCommand(unsigned short port, CommandInterface * (*factory)(unsigned short));
|
||||
|
||||
|
||||
|
||||
static bool unregisterCommand(unsigned short port, CommandInterface * (*factory)(unsigned short));
|
||||
|
||||
|
||||
|
||||
static CommandInterfaceList registeredCommands(unsigned short port);
|
||||
|
||||
|
||||
|
||||
void setUserData(void *userData);
|
||||
|
||||
|
||||
|
||||
void *userData() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
|
||||
void aboutToQuit(unsigned short port);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
|
||||
void shutdownRequest();
|
||||
|
||||
|
||||
void workerFinished();
|
||||
|
||||
protected:
|
||||
void incomingConnection(qintptr socketDescriptor);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
||||
|
||||
Private *const d;
|
||||
|
||||
explicit TcpServer(unsigned short port);
|
||||
|
||||
|
||||
|
||||
bool listen(const QHostAddress &address, quint16 port);
|
||||
};
|
||||
Reference in new issue
Block a user