Stellarium 0.15.2
|
Handling the connection to a remote peer (i.e. all clients on the server, and the server on the client) More...
#include <SyncProtocol.hpp>
Public Member Functions | |
SyncRemotePeer (QAbstractSocket *socket, bool isServer, const QVector< SyncMessageHandler * > &handlerList) | |
void | receiveMessage () |
Call this to try to receive message data from the socket. More... | |
void | writeMessage (const SyncMessage &msg) |
Sends a message to this peer. More... | |
void | writeData (const QByteArray &data, int size=-1) |
Writes this data packet to the socket without processing. More... | |
void | writeError (const QString &err) |
Can be used to write an error message to the peer and drop the connection. More... | |
void | peerLog (const QString &msg) |
Log a message for this peer. More... | |
Public Attributes | |
bool | isValid |
QAbstractSocket * | sock |
bool | isPeerAServer |
QUuid | id |
bool | isAuthenticated |
bool | authResponseSent |
bool | waitingForBody |
SyncProtocol::SyncHeader | msgHeader |
qint64 | lastReceiveTime |
qint64 | lastSendTime |
QVector< SyncMessageHandler * > | handlerList |
QByteArray | msgWriteBuffer |
Handling the connection to a remote peer (i.e. all clients on the server, and the server on the client)
Definition at line 142 of file SyncProtocol.hpp.
void SyncRemotePeer::peerLog | ( | const QString & | msg | ) |
Log a message for this peer.
void SyncRemotePeer::receiveMessage | ( | ) |
Call this to try to receive message data from the socket.
If a fully formed message is currently buffered, it is processed.
void SyncRemotePeer::writeData | ( | const QByteArray & | data, |
int | size = -1 |
||
) |
Writes this data packet to the socket without processing.
void SyncRemotePeer::writeError | ( | const QString & | err | ) |
Can be used to write an error message to the peer and drop the connection.
void SyncRemotePeer::writeMessage | ( | const SyncMessage & | msg | ) |
Sends a message to this peer.