#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.
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 200 of file tcpslavebase.cpp.
| TCPSlaveBase::~TCPSlaveBase | ( | ) | [virtual] |
Definition at line 220 of file tcpslavebase.cpp.
Member Function Documentation
| bool TCPSlaveBase::atEnd | ( | ) | const [protected] |
Returns true when end of data is reached.
Definition at line 442 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 308 of file tcpslavebase.cpp.
| int TCPSlaveBase::connectToHost | ( | const QString & | host, |
| quint16 | port, | ||
| QString * | errorString = 0 |
||
| ) | [protected] |
Same as above function except.
- Parameters:
-
host hostname port port number errorString if not NULL, the error string will be set.
- 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 321 of file tcpslavebase.cpp.
| void TCPSlaveBase::disconnectFromHost | ( | ) | [protected] |
Close the connection and forget non-permanent data like the peer host.
Definition at line 404 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 427 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 978 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 432 of file tcpslavebase.cpp.
| quint16 TCPSlaveBase::port | ( | ) | const [protected] |
the current port for this service
Definition at line 437 of file tcpslavebase.cpp.
| ssize_t TCPSlaveBase::read | ( | char * | data, |
| ssize_t | len | ||
| ) | [protected] |
Definition at line 258 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 284 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 993 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 194 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 447 of file tcpslavebase.cpp.
| void TCPSlaveBase::virtual_hook | ( | int | id, |
| void * | data | ||
| ) | [protected, virtual] |
Reimplemented from KIO::SlaveBase.
Definition at line 1002 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 985 of file tcpslavebase.cpp.
| ssize_t TCPSlaveBase::write | ( | const char * | data, |
| ssize_t | len | ||
| ) | [protected] |
Definition at line 226 of file tcpslavebase.cpp.
The documentation for this class was generated from the following files:
KDE 4.7 API Reference