![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtRPCPeer class transmits Qt signals over a network connection More...
#include <QxtRPCPeer>
Inherits QxtRPCService.
The QxtRPCPeer class transmits Qt signals over a network connection
QxtRPCPeer is a tool that encapsulates Qt signals and transmits them over a network connection. The signal is subsequently re-emitted on the receiving end of the connection.
As a QxtRPCService subclass, QxtRPCPeer can act as a client or a server. When acting as a server, it uses a QxtTcpConnectionManager to accept connections. When acting as a client, applications may use connect() to establish a TCP connection with a server.
All data types used in attached signals and slots must be declared and registered with QMetaType using Q_DECLARE_METATYPE and qRegisterMetaType. Additional requirements may be imposed by the QxtAbstractSignalSerializer subclass in use; the default QxtDataStreamSignalSerializer requires that they have stream operators registered with qRegisterMetaTypeStreamOperators.
Due to a restriction of Qt's signals and slots mechanism, the number of parameters that can be passed to call() and its related functions, as well as the number of parameters to any signal or slot attached to QxtRPCPeer, is limited to 8.
Creates a QxtRPCPeer object with the given parent.
Connects to the specified server addr on the selected port.
When the connection is complete, the connectedToServer() signal will be emitted. If an error occurs, the serverError() signal will be emitted.
Connects to the specified peer or server addr on the selected port.
When the connection is complete, the connectedToServer() signal will be emitted. If an error occurs, the serverError() signal will be emitted.
Listens on the specified interface iface on the specified port for connections.
Attempting to listen while in Client mode or while connected in Peer mode will be ignored with a warning. In Peer mode, only one connection can be active at a time. Additional incoming connections while connected to a peer will be dropped. When a peer connects, the peerConnected() signal will be emitted. In Server mode, multiple connections can be active at a time. Each client that connects will be provided a unique ID, included in the clientConnected() signal that will be emitted. Returns true if succeeds, false otherwise.
Stops listening for connections. Any connections still open will remain connected.
Copyright © 2007-2011 Qxt Foundation |
Qxt 0.6.2 |