mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
added send buffer to limit socket operations to one thread
This commit is contained in:
parent
81a5d58d70
commit
45890b836b
5 changed files with 40 additions and 7 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <QTcpSocket>
|
||||
#include <QHostAddress>
|
||||
#include <QMutex>
|
||||
#include "server_protocolhandler.h"
|
||||
|
||||
class QTcpSocket;
|
||||
|
|
@ -30,6 +31,7 @@ class QXmlStreamReader;
|
|||
class QXmlStreamWriter;
|
||||
class DeckList;
|
||||
class TopLevelProtocolItem;
|
||||
class QByteArray;
|
||||
|
||||
class ServerSocketInterface : public Server_ProtocolHandler
|
||||
{
|
||||
|
|
@ -38,11 +40,16 @@ private slots:
|
|||
void readClient();
|
||||
void catchSocketError(QAbstractSocket::SocketError socketError);
|
||||
void processProtocolItem(ProtocolItem *item);
|
||||
void flushXmlBuffer();
|
||||
signals:
|
||||
void xmlBufferChanged();
|
||||
private:
|
||||
QMutex xmlBufferMutex;
|
||||
Servatrice *servatrice;
|
||||
QTcpSocket *socket;
|
||||
QXmlStreamWriter *xmlWriter;
|
||||
QXmlStreamReader *xmlReader;
|
||||
QString xmlBuffer;
|
||||
TopLevelProtocolItem *topLevelItem;
|
||||
int getUserIdInDB(const QString &name) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue