// there is data to read on the InStream.
void initialiseProtocol();
- // processMsg() should be called whenever there is either:
- // - data available on the underlying network stream
- // In this case, processMsg may return without processing an RFB message,
- // if the available data does not result in an RFB message being ready
- // to handle. e.g. if data is encrypted.
- // NB: This makes it safe to call processMsg() in response to select()
- // - data available on the CConnection's current InStream
- // In this case, processMsg should always process the available RFB
- // message before returning.
- // NB: In either case, you must have called initialiseProtocol() first.
+ // processMsg() should be called whenever there is data available on
+ // the CConnection's current InStream. It will process at most one
+ // RFB message before returning. If there was insufficient data,
+ // then it will return false and should be called again once more
+ // data is available.
bool processMsg();
// close() gracefully shuts down the connection to the server and
// there is data to read on the InStream.
void initialiseProtocol();
- // processMsg() should be called whenever there is data to read on the
- // InStream. You must have called initialiseProtocol() first.
+ // processMsg() should be called whenever there is data available on
+ // the CConnection's current InStream. It will process at most one
+ // RFB message before returning. If there was insufficient data,
+ // then it will return false and should be called again once more
+ // data is available.
bool processMsg();
// approveConnection() is called to either accept or reject the connection.