MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / sendMessage

Method sendMessage

src/singleapplication/singleapplication.cpp:240–252  ·  view source on GitHub ↗

* Sends message to the Primary Instance. * @param message The message to send. * @param timeout the maximum timeout in milliseconds for blocking functions. * @return true if the message was sent successfuly, false otherwise. */

Source from the content-addressed store, hash-verified

238 * @return true if the message was sent successfuly, false otherwise.
239 */
240bool SingleApplication::sendMessage( const QByteArray &message, int timeout )
241{
242 Q_D( SingleApplication );
243
244 // Nobody to connect to
245 if( isPrimary() ) return false;
246
247 // Make sure the socket is connected
248 if( ! d->connectToPrimary( timeout, SingleApplicationPrivate::Reconnect ) )
249 return false;
250
251 return d->writeConfirmedMessage( timeout, message );
252}
253
254/**
255 * Cleans up the shared memory block and exits with a failure.

Callers

nothing calls this directly

Calls 2

connectToPrimaryMethod · 0.80
writeConfirmedMessageMethod · 0.80

Tested by

no test coverage detected