Home · All Classes · Grouped Classes · Annotated · Functions

QtopiaChannel Class Reference

The QtopiaChannel class provides communication capabilities between clients. More...

    #include <QtopiaChannel>

Inherits QObject.

Public Functions

Signals

Static Public Members

Additional Inherited Members


Detailed Description

The QtopiaChannel class provides communication capabilities between clients.

QtopiaChannel provides a many-to-many (broadcast) inter-process communication protocol. The messages transferred are identified by channel, message and message signature. A channel is identified by a name, and anyone who wants to can listen to it, restricted by an active security framework, if any. The QtopiaChannel protocol allows clients to communicate both within the same address space and between different processes.

There are currently two implementations for QtopiaChannel, one layered over the Qt QCop mechanism, and another one for DBus. QCop mechanism is currently only available on Qtopia Core.

Typically, QtopiaChannel is either used to send messages to a channel using the provided static functions, or to listen to the traffic on a channel by deriving from the class to take advantage of the provided functionality for receiving messages.

QtopiaChannel provides a couple of static functions which are usable without an object: The send() function, which sends the given message and data on the specified channel, and the isRegistered() function which queries the server for the existence of the given channel.

In addition, the QtopiaChannel class provides the channel() function which returns the name of the object's channel, and the received() signal which is emitted with the given message and data when a QtopiaChannel receives a message from its channel.

See also QtopiaAbstractService.


Member Function Documentation

QtopiaChannel::QtopiaChannel ( const QString & channel, QObject * parent = 0 )

Constructs a QtopiaChannel with the given parent, and starts to listen on channel name.

See also isRegistered() and channel().

QtopiaChannel::~QtopiaChannel ()   [virtual]

Destroys this QtopiaChannel instance.

QString QtopiaChannel::channel () const

Returns the name of the channel this object is listening on.

bool QtopiaChannel::flush ()   [static]

Flushes all pending messages destined from this channel, causing them to be sent immediately. Returns true if the flush succeeded; otherwise returns false.

bool QtopiaChannel::isRegistered ( const QString & channel )   [static]

Returns true if the channel is registered. Note that this function always returns true in the DBus implementation. In the QCop implementation, this function requires a round-trip to the QWS server, which may impact system performance.

void QtopiaChannel::received ( const QString & message, const QByteArray & data )   [signal]

This signal is emitted with the given message and data whenever the channel receives a message on the channel being listened on.

See also send().

bool QtopiaChannel::send ( const QString & channel, const QString & msg )   [static]

Sends a message msg with no parameters on channel. Returns true if able to send the message; otherwise returns false.

See also received().

bool QtopiaChannel::send ( const QString & channel, const QString & msg, const QByteArray & data )   [static]

This is an overloaded member function, provided for convenience.

Sends a message msg on channel channel with the parameter data given by data. Returns true if able to send the message; otherwise returns false.

See also received().


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3