mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-29 19:24:42 +00:00
31 lines
622 B
C++
31 lines
622 B
C++
#ifndef SERVER_SP_H
|
|
#define SERVER_SP_H
|
|
#include "serverprotocol.h"
|
|
#include "serverprotocol_global.h"
|
|
#include <QLocalServer>
|
|
|
|
class QLocalSocket;
|
|
namespace ServerProtocol {
|
|
|
|
class SERVERPROTOCOLSHARED_EXPORT Server: public QLocalServer
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QLocalSocket *_client;
|
|
Package _downloadPackage;
|
|
|
|
void parsePackage(const Package &pkg);
|
|
|
|
private slots:
|
|
void avelableBytes();
|
|
|
|
protected:
|
|
void incomingConnection(quintptr socketDescriptor) override;
|
|
public:
|
|
explicit Server(QObject * ptr = nullptr);
|
|
~Server() override;
|
|
bool run(const QString& name);
|
|
};
|
|
}
|
|
#endif // SERVER_SP_H
|