KIO
#include <tcpslavebase.h>

Public Member Functions | |
| TCPSlaveBase (const QByteArray &protocol, const QByteArray &poolSocket, const QByteArray &appSocket, bool autoSsl=false) | |
| virtual | ~TCPSlaveBase () |
Protected Types | |
| enum | SslResultDetail { ResultOk = 1, ResultOverridden = 2, ResultFailed = 4, ResultFailedEarly = 8 } |
Protected Member Functions | |
| bool | atEnd () const |
| bool | connectToHost (const QString &protocol, const QString &host, quint16 port) |
| int | connectToHost (const QString &host, quint16 port, QString *errorString=0) |
| void | disconnectFromHost () |
| bool | isAutoSsl () const |
| bool | isConnected () const |
| bool | isUsingSsl () const |
| quint16 | port () const |
| ssize_t | read (char *data, ssize_t len) |
| ssize_t | readLine (char *data, ssize_t len) |
| void | setBlocking (bool b) |
| QIODevice * | socket () const |
| bool | startSsl () |
| virtual void | virtual_hook (int id, void *data) |
| bool | waitForResponse (int t) |
| ssize_t | write (const char *data, ssize_t len) |
Detailed Description
There are two classes that specifies the protocol between application (job) and kioslave.
SlaveInterface is the class to use on the application end, SlaveBase is the one to use on the slave end.
Slave implementations should simply inherit SlaveBase
A call to foo() results in a call to slotFoo() on the other end.
Definition at line 46 of file tcpslavebase.h.
Member Enumeration Documentation
enum KIO::TCPSlaveBase::SslResultDetail [protected] |
Definition at line 63 of file tcpslavebase.h.
Constructor & Destructor Documentation
| TCPSlaveBase::TCPSlaveBase | ( | const QByteArray & | protocol, |
| const QByteArray & | poolSocket, | ||
| const QByteArray & | appSocket, | ||
| bool | autoSsl = false |
||
| ) |
Constructor.
- Parameters:
-
autoSsl if true, will automatically invoke startSsl() right after connecting. In the absence of errors the use of SSL will therefore be transparent to higher layers.
Definition at line 188 of file tcpslavebase.cpp.
| TCPSlaveBase::~TCPSlaveBase | ( | ) | [virtual] |
Definition at line 208 of file tcpslavebase.cpp.
Member Function Documentation
| bool TCPSlaveBase::atEnd | ( | ) | const [protected] |
Returns true when end of data is reached.
Definition at line 438 of file tcpslavebase.cpp.
| bool TCPSlaveBase::connectToHost | ( | const QString & | protocol, |
| const QString & | host, | ||
| quint16 | port | ||
| ) | [protected] |
Performs the initial TCP connection stuff and/or SSL handshaking as necessary.
- Parameters:
-
protocol the protocol being used host hostname port port number
- Returns:
- on succes, true is returned. on failure, false is returned and an appropriate error message is sent to the application.
Definition at line 296 of file tcpslavebase.cpp.
| int TCPSlaveBase::connectToHost | ( | const QString & | host, |
| quint16 | port, | ||
| QString * | errorString = 0 |
||
| ) | [protected] |
Connects to the specified host and port.
- Parameters:
-
host host name port port number errorString if not NULL, this string will contain error information on why the connection request failed.
- Returns:
- on success, 0 is returned. on failure, a KIO::Error code is returned. errorString, if not NULL, will contain the appropriate error message that can be sent back to the client.
- Since:
- 4.7.2
Definition at line 309 of file tcpslavebase.cpp.
| void TCPSlaveBase::disconnectFromHost | ( | ) | [protected] |
Close the connection and forget non-permanent data like the peer host.
Definition at line 400 of file tcpslavebase.cpp.
| bool TCPSlaveBase::isAutoSsl | ( | ) | const [protected] |
Will start SSL after connecting?
- Returns:
- if so, true is returned. if not, false is returned.
Definition at line 423 of file tcpslavebase.cpp.
| bool TCPSlaveBase::isConnected | ( | ) | const [protected] |
Determines whether or not we are still connected to the remote machine.
return true if the socket is still active or false otherwise.
Definition at line 974 of file tcpslavebase.cpp.
| bool TCPSlaveBase::isUsingSsl | ( | ) | const [protected] |
Is the current connection using SSL?
- Returns:
- if so, true is returned. if not, false is returned.
Definition at line 428 of file tcpslavebase.cpp.
| quint16 TCPSlaveBase::port | ( | ) | const [protected] |
| ssize_t TCPSlaveBase::read | ( | char * | data, |
| ssize_t | len | ||
| ) | [protected] |
Definition at line 246 of file tcpslavebase.cpp.
| ssize_t TCPSlaveBase::readLine | ( | char * | data, |
| ssize_t | len | ||
| ) | [protected] |
Same as read() except it reads data one line at a time.
Definition at line 272 of file tcpslavebase.cpp.
| void TCPSlaveBase::setBlocking | ( | bool | b | ) | [protected] |
Sets the mode of the connection to blocking or non-blocking.
Be sure to call this function before calling connectToHost. Otherwise, this setting will not have any effect until the next connectToHost.
- Parameters:
-
b true to make the connection a blocking one, false otherwise.
Definition at line 989 of file tcpslavebase.cpp.
| QIODevice * TCPSlaveBase::socket | ( | ) | const [protected] |
Return the socket object, if the class ever needs to do anything to it.
Definition at line 182 of file tcpslavebase.cpp.
| bool TCPSlaveBase::startSsl | ( | ) | [protected] |
Start using SSL on the connection.
You can use it right after connecting for classic, transparent to the protocol SSL. Calling it later can be used to implement e.g. SMTP's STARTTLS feature.
- Returns:
- on success, true is returned. on failure, false is returned.
Definition at line 443 of file tcpslavebase.cpp.
| void TCPSlaveBase::virtual_hook | ( | int | id, |
| void * | data | ||
| ) | [protected, virtual] |
Reimplemented from KIO::SlaveBase.
Definition at line 998 of file tcpslavebase.cpp.
| bool TCPSlaveBase::waitForResponse | ( | int | t | ) | [protected] |
Wait for incoming data on the socket for the period specified by t.
- Parameters:
-
t length of time in seconds that we should monitor the socket before timing out.
- Returns:
- true if any data arrived on the socket before the timeout value was reached, false otherwise.
Definition at line 981 of file tcpslavebase.cpp.
| ssize_t TCPSlaveBase::write | ( | const char * | data, |
| ssize_t | len | ||
| ) | [protected] |
Definition at line 214 of file tcpslavebase.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 18:22:02 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.