Socket Interface: Comments and debug message possibilities

This commit is contained in:
Jacob Støren 2013-10-04 11:12:31 +02:00
parent 90402c285d
commit 4efeba4a51
2 changed files with 15 additions and 2 deletions

View File

@ -20,7 +20,8 @@
//////////////////////////////////////////////////////////////////////////
/// Socket commands, to be moved into a separate file
/// The base class for classes interpreting commands sent via socket.
/// Works in close connection with RiaSocketServer
//////////////////////////////////////////////////////////////////////////
class RiaSocketServer;
@ -30,7 +31,18 @@ class RiaSocketCommand
{
public:
virtual ~RiaSocketCommand() {}
/// This method is supposed to interpret the commands received from the calling socket connection and
/// read the data currently available.
/// If it read all the data and completed the command, it is supposed to return true. If it did not read all the data,
/// it is supposed to return false. The socket server will then assume that the command is not completely interpreted,
/// and will continue to call interpretMore() until that method returns true.
virtual bool interpretCommand(RiaSocketServer* server, const QList<QByteArray>& args, QDataStream& socketStream) = 0;
/// This method is supposed to read whatever more data that is available on the socket connection, and return true if it
/// was able to read all the data. If not all the data was available, it must return false, so that the RiaSocketServer
/// will call this method again when more data becomes available.
virtual bool interpretMore(RiaSocketServer* server, QTcpSocket* currentClient) { return true; }
};

View File

@ -52,12 +52,13 @@ public:
void startMonitorWorkProcess(caf::UiProcess* process);
void stopMonitorWorkProcess();
void addStringToLog(const QString& text);
public slots:
void slotClearTextEdit();
private:
void setStatusMsg(const QString& status, int messageType);
void addStringToLog(const QString& text);
private slots:
void slotShowProcStatusMsg(const QString& message, int messageType);