KDEGames
kmessageclient.cpp
79 connect(connection, &KMessageIO::connectionBroken, this, &KMessageClient::removeBrokenConnection);
Definition: kmessageio.h:49
void setServer(const QString &host, quint16 port)
Connects the client to (another) server.
Definition: kmessageclient.cpp:57
virtual bool open(QIODevice::OpenMode flags) override
void connectionBroken()
This signal is emitted when the connection is closed.
WriteOnly
void forwardReceived(const QByteArray &msg, quint32 senderID, const QList< quint32 > &receivers)
This signal is emitted when the client receives a forward message from the KMessageServer,...
Q_EMITQ_EMIT
void connectionBroken()
This signal is emitted when the connection to the KMessageServer is broken.
singleShot
unsigned int delayedMessageCount() const
Definition: kmessageclient.cpp:329
void serverMessageReceived(const QByteArray &msg, bool &unknown)
This signal is emitted on every message that came from the server.
void processFirstMessage()
Called from unlock() (using QTimer::singleShot) until all delayed messages are delivered.
Definition: kmessageclient.cpp:270
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void sendBroadcast(const QByteArray &msg)
Sends a message to all the clients connected to the server, including ourself.
Definition: kmessageclient.cpp:136
void eventClientDisconnected(quint32 clientID, bool broken)
This signal is emitted when the server has lost the connection to one of the clients (This could be b...
void unlock()
Deliver every message that was delayed by lock() and actually deliver all messages that get received ...
Definition: kmessageclient.cpp:321
void sendServerMessage(const QByteArray &msg)
Sends a message to the KMessageServer.
Definition: kmessageclient.cpp:127
void addClient(KMessageIO *)
Adds a new KMessageIO object to the communication server.
Definition: kmessageserver.cpp:162
void sendForward(const QByteArray &msg, const QList< quint32 > &clients)
Sends a message to all the clients in a list.
Definition: kmessageclient.cpp:148
Definition: kmessageio.h:169
virtual void processIncomingMessage(const QByteArray &msg)
This slot is called from the signal KMessageIO::received whenever a message from the KMessageServer a...
Definition: kmessageclient.cpp:167
int receivers(const char *signal) const const
void disconnect()
Corresponds to setServer(0); but also emits the connectionBroken signal.
Definition: kmessageclient.cpp:304
void adminStatusChanged(bool isAdmin)
This signal is emitted when this client becomes the admin client or when it loses the admin client st...
void setData(const QByteArray &data)
void received(const QByteArray &msg)
This signal is emitted when /e send() on the connected KMessageIO object is called.
ScriptableExtension * host() const
void lock()
Once this function is called no message will be received anymore.
Definition: kmessageclient.cpp:316
virtual void processMessage(const QByteArray &msg)
This slot is called from processIncomingMessage or processFirstMessage, depending on whether the clie...
Definition: kmessageclient.cpp:183
QByteArray readAll()
void eventClientConnected(quint32 clientID)
This signal is emitted when another client has connected to the server.
A server for message sending and broadcasting, using TCP/IP connections.
Definition: kmessageserver.h:166
virtual bool atEnd() const const override
Definition: kmessageio.h:298
virtual void removeBrokenConnection()
This slot is called from the signal KMessageIO::connectionBroken.
Definition: kmessageclient.cpp:284
void aboutToDisconnect(quint32 id)
This signal is emitted right before the client disconnects.
void broadcastReceived(const QByteArray &msg, quint32 senderID)
This signal is emitted when the client receives a broadcast message from the KMessageServer,...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:49:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:49:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.