KIO::TCPSlaveBase Class Reference
There are two classes that specifies the protocol between application (job) and kioslave. More...
#include <tcpslavebase.h>
Inheritance diagram for KIO::TCPSlaveBase:

Protected Methods | |
ssize_t | Write (const void *data, ssize_t len) |
ssize_t | Read (void *data, ssize_t len) |
ssize_t | ReadLine (char *data, ssize_t len) |
unsigned short int | GetPort (unsigned short int p) |
bool | ConnectToHost (const QString &host, unsigned int port, bool sendError) |
void | CloseDescriptor () |
bool | AtEOF () |
bool | InitializeSSL () |
void | CleanSSL () |
ssize_t | write (const void *data, ssize_t len) |
This function acts like standard write function call except it is also capable of making SSL or SOCKS connections. | |
ssize_t | read (void *data, ssize_t len) |
This function acts like standard read function call except it is also capable of deciphering SSL data as well as handling data over SOCKSified connections. | |
ssize_t | readLine (char *data, ssize_t len) |
Same as above except it reads data one line at a time. | |
void | setBlockSize (int sz) |
Sets the maximum size of blocks read in during calls to readLine(). | |
unsigned short int | port (unsigned short int) |
Determines the appropiate port to use. | |
bool | connectToHost (const QString &host, unsigned int port, bool sendError=true) |
Performs the initial TCP connection stuff and/or SSL handshaking as necessary. | |
bool | usingTLS () |
Are we using TLS? | |
bool | canUseTLS () |
Can we use TLS? | |
int | startTLS () |
Start using TLS on the connection. | |
void | stopTLS () |
Stop using TLS on the connection. | |
void | closeDescriptor () |
Closes the current file descriptor. | |
bool | atEnd () |
Returns true when end of data is reached. | |
void | setSSLMetaData () |
Call this if you use persistent connections and want all the metadata restored. | |
bool | initializeSSL () |
Initializs all SSL variables. | |
void | cleanSSL () |
Cleans up all SSL settings. | |
bool | isConnectionValid () |
Determines whether or not we are still connected to the remote machine. | |
int | connectResult () |
Returns the status of the connection. | |
bool | waitForResponse (int t) |
Wait for some type of activity on the socket for the period specified by t . | |
void | setBlockConnection (bool b) |
Sets the mode of the connection to blocking or non-blocking. | |
void | setConnectTimeout (int t) |
Sets how long to wait for orignally connecting to the requested before timinig out. | |
bool | isSSLTunnelEnabled () |
Returns true if SSL tunneling is enabled. | |
void | setEnableSSLTunnel (bool enable) |
Set up SSL tunneling mode. | |
void | setRealHost (const QString &realHost) |
Sets up the the real hostname for an SSL connection that goes through a proxy server. | |
virtual void | virtual_hook (int id, void *data) |
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 48 of file tcpslavebase.h.
Member Function Documentation
|
Definition at line 66 of file tcpslavebase.h. References KIO::SlaveBase::data(), and write(). |
|
Definition at line 71 of file tcpslavebase.h. References KIO::SlaveBase::data(), and read(). |
|
Definition at line 76 of file tcpslavebase.h. References KIO::SlaveBase::data(), and readLine(). |
|
Definition at line 81 of file tcpslavebase.h. References port(). |
|
Definition at line 86 of file tcpslavebase.h. References connectToHost(), and port(). |
|
Definition at line 92 of file tcpslavebase.h. References closeDescriptor(). |
|
Definition at line 97 of file tcpslavebase.h. References atEnd(). |
|
Definition at line 102 of file tcpslavebase.h. References initializeSSL(). |
|
Definition at line 107 of file tcpslavebase.h. References cleanSSL(). |
|
This function acts like standard write function call except it is also capable of making SSL or SOCKS connections.
Definition at line 153 of file tcpslavebase.cpp. References KIO::SlaveBase::data(), KSocks::self(), and KSocks::write(). Referenced by Write(). |
|
This function acts like standard read function call except it is also capable of deciphering SSL data as well as handling data over SOCKSified connections.
Definition at line 164 of file tcpslavebase.cpp. References KIO::SlaveBase::data(), KSocks::read(), and KSocks::self(). Referenced by Read(). |
|
Same as above except it reads data one line at a time.
Definition at line 185 of file tcpslavebase.cpp. References KIO::SlaveBase::data(), KSocks::read(), and KSocks::self(). Referenced by ReadLine(). |
|
Sets the maximum size of blocks read in during calls to readLine(). This allows a slave to optimize for the protocol which it implements. Ideally this should be (common_line_length+1) or so. Making this too large will have adverse effects on performance. Initial/default value is 256(bytes) Definition at line 176 of file tcpslavebase.cpp. |
|
Determines the appropiate port to use. This functions attempts to discover the appropriate port.
Definition at line 273 of file tcpslavebase.cpp. Referenced by ConnectToHost(), connectToHost(), and GetPort(). |
|
Performs the initial TCP connection stuff and/or SSL handshaking as necessary. Please note that unlike its deprecated counterpart, this function allows you to disable any error message from being sent back to the calling application! You can then use the connectResult() function to determine the result of the request for connection.
Definition at line 291 of file tcpslavebase.cpp. References KExtendedSocket::blockingMode(), closeDescriptor(), KExtendedSocket::connect(), KIO::SlaveBase::error(), KExtendedSocket::fd(), KIO::SlaveBase::messageBox(), KIO::SlaveBase::metaData(), KSocketAddress::nodeName(), KExtendedSocket::peerAddress(), port(), KExtendedSocket::release(), KExtendedSocket::setAddress(), KExtendedSocket::setBlockingMode(), KIO::SlaveBase::setMetaData(), and KExtendedSocket::setTimeout(). Referenced by ConnectToHost(). |
|
Are we using TLS?
Definition at line 703 of file tcpslavebase.cpp. |
|
Can we use TLS?
Definition at line 483 of file tcpslavebase.cpp. |
|
Start using TLS on the connection.
Definition at line 422 of file tcpslavebase.cpp. References KIO::SlaveBase::setMetaData(). |
|
Stop using TLS on the connection.
Definition at line 465 of file tcpslavebase.cpp. References KIO::SlaveBase::setMetaData(). Referenced by closeDescriptor(). |
|
Closes the current file descriptor. Call this function to properly close up the socket since it also takes care to prroperly close the stdio fstream stuff, as well as sets the socket back to -1 Definition at line 377 of file tcpslavebase.cpp. References stopTLS(). Referenced by CloseDescriptor(), and connectToHost(). |
|
Returns true when end of data is reached.
Definition at line 417 of file tcpslavebase.cpp. Referenced by AtEOF(). |
|
Call this if you use persistent connections and want all the metadata restored. This is particularily important for SSL sessions since the app needs to know the state of connection, certificates, etc. Definition at line 475 of file tcpslavebase.cpp. |
|
Initializs all SSL variables.
Definition at line 395 of file tcpslavebase.cpp. Referenced by InitializeSSL(). |
|
Cleans up all SSL settings.
Definition at line 406 of file tcpslavebase.cpp. Referenced by CleanSSL(). |
|
Determines whether or not we are still connected to the remote machine. This method may fail to detect a closed SSL connection.
return Definition at line 1073 of file tcpslavebase.cpp. References KSocks::recv(), KSocks::select(), and KSocks::self(). |
|
Returns the status of the connection.
This function allows you to invoke ConnectToHost with the
Definition at line 1159 of file tcpslavebase.cpp. |
|
Wait for some type of activity on the socket for the period specified by
Definition at line 1116 of file tcpslavebase.cpp. References KSocks::select(), and KSocks::self(). |
|
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
Definition at line 1164 of file tcpslavebase.cpp. |
|
Sets how long to wait for orignally connecting to the requested before timinig out.
Be sure to call this function before calling ConnectToHost, otherwise the setting will not take effect until the next call to
Definition at line 1169 of file tcpslavebase.cpp. |
|
Returns true if SSL tunneling is enabled.
Definition at line 1174 of file tcpslavebase.cpp. |
|
Set up SSL tunneling mode.
Calling this function with a Note that once you have successfully "tunneled" through the proxy server you must call this function with its argument set to false to properly connect to the SSL site.
Definition at line 1179 of file tcpslavebase.cpp. |
|
Sets up the the real hostname for an SSL connection that goes through a proxy server. This function is essential in making sure that the real hostname is used for validating certificates from SSL sites!
Definition at line 1184 of file tcpslavebase.cpp. |
The documentation for this class was generated from the following files: