
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:
-
_cmd the received command will be written here data the 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:
-
cmd the command to set arr the 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:
-
_cmd the command to set data the 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:
-
ms the 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:
KDE 4.7 API Reference