Remoto - VFS: VFS_websocket_VFSclient.h Source File
Remoto - VFS
VFS_websocket_VFSclient.h
Go to the documentation of this file.
1 #ifndef VFS_WEBSOCKET_VFSCLIENT_H
2 #define VFS_WEBSOCKET_VFSCLIENT_H
3 
4 #include "VFS_websocket_client.h"
5 
7 {
8  Q_OBJECT
9 
10  public:
11  explicit VFS_websocket_VFSclient(QString wsurl, QString username, QString password="", quint16 interval=3000);
12  virtual ~VFS_websocket_VFSclient();
13 
14  void sendText(QString command, QJsonObject attributes);
15  void sendBinary(QString command, QJsonObject attributes);
16 
17  protected:
18  QString _username;
19  QString _password;
20 
21  virtual QJsonDocument receive(QByteArray message);
22 
23  private:
24 
25  signals:
26  void authorized();
27  void authDenied();
28  void commandReceived(QString command, QJsonObject attributes);
29 
30  protected slots:
31  virtual void socket_connected();
32 };
33 
34 #endif
Create a websocket client that will observe VFS connection rules like auth and reconnect.
virtual QJsonDocument receive(QByteArray message)
Receive a message from the server.
QString _password
password used when authenticating
void authDenied()
A connection was attempted, but authorization was denied.
void sendText(QString command, QJsonObject attributes)
Send a VFS command as a text message.
void sendBinary(QString command, QJsonObject attributes)
Send a VFS command as a text message.
void commandReceived(QString command, QJsonObject attributes)
A command was received, but it needs to be processed by a listener.
QString _username
username used when authenticating
void authorized()
A connection has been made and authorization is complete.
virtual void socket_connected()
Override the default VFS_websocket_client::socket_connected() command to include an authorization ste...
VFS_websocket_VFSclient(QString wsurl, QString username, QString password="", quint16 interval=3000)
Create a websocket client that will observe VFS connection rules like auth and reconnect.
A VFS_node that manages a QWebSocket connection.