mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Socket Interface: Comments and debug message possibilities
This commit is contained in:
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user