• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KIO

  • KIO
  • Connection
Signals | Public Member Functions
KIO::Connection Class Reference
Inheritance diagram for KIO::Connection:
Inheritance graph
[legend]

List of all members.

Signals

void readyRead ()

Public Member Functions

 Connection (QObject *parent=0)
virtual ~Connection ()
void close ()
void connectToRemote (const QString &address)
QString errorString () const
bool hasTaskAvailable () const
bool inited () const
bool isConnected () const
int read (int *_cmd, QByteArray &data)
void resume ()
bool send (int cmd, const QByteArray &arr=QByteArray())
bool sendnow (int _cmd, const QByteArray &data)
void suspend ()
bool suspended () const
bool waitForIncomingTask (int ms=30000)

Detailed Description

This class provides a simple means for IPC between two applications via a pipe.

It handles a queue of commands to be sent which makes it possible to queue data before an actual connection has been established.


Constructor & Destructor Documentation

Connection::Connection ( QObject *  parent = 0) [explicit]

Creates a new connection.

See also:
connectToRemote, listenForRemote

Definition at line 392 of file connection.cpp.

Connection::~Connection ( ) [virtual]

Definition at line 398 of file connection.cpp.


Member Function Documentation

void Connection::close ( )

Closes the connection.

Definition at line 423 of file connection.cpp.

void Connection::connectToRemote ( const QString &  address)

Connects to the remote address.

Definition at line 449 of file connection.cpp.

QString Connection::errorString ( ) const

Definition at line 477 of file connection.cpp.

bool Connection::hasTaskAvailable ( ) const

Returns true if there are packets to be read immediately, false if waitForIncomingTask must be called before more data is available.

Definition at line 512 of file connection.cpp.

bool Connection::inited ( ) const

Checks whether the connection has been initialized.

Returns:
true if the initialized
See also:
init()

Definition at line 439 of file connection.cpp.

bool Connection::isConnected ( ) const

Definition at line 434 of file connection.cpp.

int Connection::read ( int *  _cmd,
QByteArray &  data 
)

Receive data.

Parameters:
_cmdthe received command will be written here
datathe received data will be written here
Returns:
>=0 indicates the received data size upon success -1 indicates error

Definition at line 527 of file connection.cpp.

void KIO::Connection::readyRead ( ) [signal]
void Connection::resume ( )

Resume handling of incoming data.

Definition at line 412 of file connection.cpp.

bool Connection::send ( int  cmd,
const QByteArray &  arr = QByteArray() 
)

Sends/queues the given command to be sent.

Parameters:
cmdthe command to set
arrthe bytes to send
Returns:
true if successful, false otherwise

Definition at line 484 of file connection.cpp.

bool Connection::sendnow ( int  _cmd,
const QByteArray &  data 
)

Sends the given command immediately.

Parameters:
_cmdthe command to set
datathe bytes to send
Returns:
true if successful, false otherwise

Definition at line 497 of file connection.cpp.

void Connection::suspend ( )

Don't handle incoming data until resumed.

Definition at line 404 of file connection.cpp.

bool Connection::suspended ( ) const

Returns status of connection.

Returns:
true if suspended, false otherwise

Definition at line 444 of file connection.cpp.

bool Connection::waitForIncomingTask ( int  ms = 30000)

Waits for one more command to be handled and ready.

Parameters:
msthe time to wait in milliseconds
Returns:
true if one command can be read, false if we timed out

Definition at line 517 of file connection.cpp.


The documentation for this class was generated from the following files:
  • connection.h
  • connection.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal