#include <srcp_virtual_client.h>
Inherits VirtualClient.
Inherited by Srcp083Client.
Public Slots | |
void | setConnection (const bool &c) |
Public Member Functions | |
SrcpVirtualClient (QObject *parent) | |
Create the info and command client, and connect signals and slots. | |
~SrcpVirtualClient () | |
Destructor, ensure that the connection is closed. | |
SrcpSocket * | commandClient () |
Private Slots | |
virtual void | parseInfo (QString info)=0 |
virtual void | srcpHandshake ()=0 |
The SRCP handshake. | |
Private Attributes | |
SrcpSocket * | _infoClient |
The info client. It contains a thread reading the infos send by the server. | |
SrcpSocket * | _commandClient |
The command client. |
This class contain two private members storing the info and the command client which need to be separatly connected.
Definition at line 24 of file srcp_virtual_client.h.
SrcpVirtualClient::SrcpVirtualClient | ( | QObject * | parent | ) |
Create the info and command client, and connect signals and slots.
Definition at line 4 of file srcp_virtual_client.cpp.
References _commandClient, _infoClient, VirtualClient::errorOccured(), VirtualClient::infoReceived(), parseInfo(), and srcpHandshake().
SrcpVirtualClient::~SrcpVirtualClient | ( | ) |
Destructor, ensure that the connection is closed.
Definition at line 21 of file srcp_virtual_client.cpp.
References setConnection().
SrcpSocket * SrcpVirtualClient::commandClient | ( | ) |
Definition at line 26 of file srcp_virtual_client.cpp.
References _commandClient.
Referenced by Srcp083Client::sendCommand().
void SrcpVirtualClient::setConnection | ( | const bool & | c | ) | [virtual, slot] |
Connect or disconnect form host
c | The connection state to set |
Implements VirtualClient.
Definition at line 31 of file srcp_virtual_client.cpp.
References _commandClient, _infoClient, VirtualClient::_serverAddress, VirtualClient::_serverPort, and SrcpSocket::threadSafeDisconnectFromHost().
Referenced by Srcp083Client::srcpHandshake(), and ~SrcpVirtualClient().
virtual void SrcpVirtualClient::parseInfo | ( | QString | info | ) | [private, pure virtual, slot] |
Parse the info received from the SRCP server, need to be implemented in a concrete SRCP client class.
info | The info received |
Implemented in Srcp083Client.
Referenced by SrcpVirtualClient().
virtual void SrcpVirtualClient::srcpHandshake | ( | ) | [private, pure virtual, slot] |
The SRCP handshake.
Need to be implemented in a concrete SRCP client class. It does an handshake with the SRCP server, sets the right protocol and checks if it is supported, then it set the right connection mode (i.e command or info). After that it send the GO to the server.
Implemented in Srcp083Client.
Referenced by SrcpVirtualClient().
SrcpSocket* SrcpVirtualClient::_infoClient [private] |
The info client. It contains a thread reading the infos send by the server.
Definition at line 66 of file srcp_virtual_client.h.
Referenced by setConnection(), and SrcpVirtualClient().
SrcpSocket* SrcpVirtualClient::_commandClient [private] |
The command client.
Definition at line 69 of file srcp_virtual_client.h.
Referenced by commandClient(), setConnection(), and SrcpVirtualClient().