Qt Extended Home · Index · Classes · Headers · Overviews codeless banner

QDLinkPlugin Class Reference

The QDLinkPlugin class is responsible for maintaining a network link. More...

    #include <QDLinkPlugin>

Inherits QDPlugin.

Public Types

Public Functions

Signals

Protected Functions

Additional Inherited Members


Detailed Description

The QDLinkPlugin class is responsible for maintaining a network link.

This plugin should be used to bring up a network interface and provide an IP address for Qt Extended Sync Agent to connect to.


Member Type Documentation

enum QDLinkPlugin::State

This enum type specifies the state of the connection.

ConstantValueDescription
QDLinkPlugin::Up0The link is up.
QDLinkPlugin::Down1The link is down.


Member Function Documentation

QDLinkPlugin::QDLinkPlugin ( QObject * parent = 0 )

Construct a QDLinkPlugin with parent as the owning QObject.

QDLinkPlugin::~QDLinkPlugin ()   [virtual]

Destructor.

int QDLinkPlugin::ping_interval ()   [virtual]

Returns the time in miliseconds between pings. Returning 0 will disable the pings, relying on the underlying connection to correctly indicate loss of connection.

Note that this value can be overridden by the user when operating in debug mode.

bool QDLinkPlugin::send_ack ()   [virtual]

Returns true if HELPER_ACK commands should be sent, false otherwise.

void QDLinkPlugin::setState ( QDLinkPlugin * plugin, int state )   [signal]

This signal should be emitted by the plugin to indicate changes in state using a constant from the QDLinkPlugin::State enum.

void QDLinkPlugin::setupSocket ( QIODevice * device )   [protected]

Call this function after you have created your device to initialize the socket. Note that the device will be moved to a separate thread so you should not interact with it except via signals. For the proxy device that you can interact with see QDLinkPlugin::socket().

Ownership of device is taken by QDLinkPlugin and it will be destroyed when the plugin is destroyed but you can delete it yourself using the QObject::deleteLater() function.

QIODevice * QDLinkPlugin::socket ()

Returns the socket for connections to use or 0 if the socket has not been initialized.

void QDLinkPlugin::stop ()   [pure virtual]

Tear down the link. The socket() function should return 0 once this function has been called.

bool QDLinkPlugin::tryConnect ( QDConPlugin * connection )   [pure virtual]

Attempt to bring up the link, using the port from connection (for TCP/IP-based links). Return false to indicate immediate failure and the setState() signal to indicate asynchronous failure.


Copyright © 2009 Trolltech
Qt Extended Sync Agent Documentation