#include <tcpslavebase.h>
Public Member Functions | |
TCPSlaveBase (unsigned short int defaultPort, const TQCString &protocol, const TQCString &poolSocket, const TQCString &appSocket) | |
TCPSlaveBase (unsigned short int defaultPort, const TQCString &protocol, const TQCString &poolSocket, const TQCString &appSocket, bool useSSL) | |
Public Member Functions inherited from TDEIO::SlaveBase | |
SlaveBase (const TQCString &protocol, const TQCString &pool_socket, const TQCString &app_socket) | |
void | exit () |
void | dispatchLoop () |
void | setConnection (Connection *connection) |
Connection * | connection () const |
void | data (const TQByteArray &data) |
void | dataReq () |
void | error (int _errid, const TQString &_text) |
void | connected () |
void | finished () |
void | needSubURLData () |
void | slaveStatus (const TQString &host, bool connected) |
void | statEntry (const UDSEntry &_entry) |
void | listEntries (const UDSEntryList &_entry) |
bool | canResume (TDEIO::filesize_t offset) |
void | canResume () |
void | totalSize (TDEIO::filesize_t _bytes) |
void | processedSize (TDEIO::filesize_t _bytes) |
void | processedPercent (float percent) |
void | speed (unsigned long _bytes_per_second) |
void | redirection (const KURL &_url) |
void | errorPage () |
void | mimeType (const TQString &_type) |
void | warning (const TQString &msg) |
void | infoMessage (const TQString &msg) |
int | messageBox (MessageBoxType type, const TQString &text, const TQString &caption=TQString::null, const TQString &buttonYes=TQString::null, const TQString &buttonNo=TQString::null) |
int | messageBox (const TQString &text, MessageBoxType type, const TQString &caption=TQString::null, const TQString &buttonYes=TQString::null, const TQString &buttonNo=TQString::null, const TQString &dontAskAgainName=TQString::null) |
void | setMetaData (const TQString &key, const TQString &value) |
bool | hasMetaData (const TQString &key) const |
TQString | metaData (const TQString &key) const |
bool | hasMetaData (const TQString &key) |
TQString | metaData (const TQString &key) |
MetaData | allMetaData () const |
TDEConfigBase * | config () |
KRemoteEncoding * | remoteEncoding () |
virtual void | setHost (const TQString &host, int port, const TQString &user, const TQString &pass) |
virtual void | setSubURL (const KURL &url) |
virtual void | openConnection () |
virtual void | closeConnection () |
virtual void | get (const KURL &url) |
virtual void | put (const KURL &url, int permissions, bool overwrite, bool resume) |
virtual void | stat (const KURL &url) |
virtual void | mimetype (const KURL &url) |
virtual void | listDir (const KURL &url) |
virtual void | mkdir (const KURL &url, int permissions) |
virtual void | rename (const KURL &src, const KURL &dest, bool overwrite) |
virtual void | symlink (const TQString &target, const KURL &dest, bool overwrite) |
virtual void | chmod (const KURL &url, int permissions) |
virtual void | copy (const KURL &src, const KURL &dest, int permissions, bool overwrite) |
virtual void | del (const KURL &url, bool isfile) |
virtual void | special (const TQByteArray &data) |
virtual void | multiGet (const TQByteArray &data) |
virtual void | slave_status () |
virtual void | reparseConfiguration () |
virtual void | localURL (const KURL &remoteURL) |
int | connectTimeout () |
int | proxyConnectTimeout () |
int | responseTimeout () |
int | readTimeout () |
void | setTimeoutSpecialCommand (int timeout, const TQByteArray &data=TQByteArray()) |
virtual bool | dispatch () |
virtual void | dispatch (int command, const TQByteArray &data) |
int | readData (TQByteArray &buffer) |
void | listEntry (const UDSEntry &_entry, bool ready) |
void | connectSlave (const TQString &path) |
void | disconnectSlave () |
bool | openPassDlg (TDEIO::AuthInfo &info, const TQString &errorMsg) |
bool | openPassDlg (TDEIO::AuthInfo &info) |
bool | checkCachedAuthentication (AuthInfo &info) |
bool | cacheAuthentication (const AuthInfo &info) |
bool | pingCacheDaemon () const |
TQString | createAuthCacheKey (const KURL &url) |
void | sendAuthenticationKey (const TQCString &gKey, const TQCString &key, bool keep) |
void | delCachedAuthentication (const TQString &key) |
void | setMultipleAuthCaching (bool) |
bool | multipleAuthCaching () const |
bool | requestNetwork (const TQString &host=TQString::null) |
void | dropNetwork (const TQString &host=TQString::null) |
DCOPClient * | dcopClient () |
int | waitForAnswer (int expected1, int expected2, TQByteArray &data, int *pCmd=0) |
void | sendMetaData () |
bool | wasKilled () const |
void | setKillFlag () |
Protected Member Functions | |
KDE_DEPRECATED ssize_t | Write (const void *data, ssize_t len) |
KDE_DEPRECATED ssize_t | Read (void *data, ssize_t len) |
KDE_DEPRECATED ssize_t | ReadLine (char *data, ssize_t len) |
KDE_DEPRECATED unsigned short int | GetPort (unsigned short int p) |
KDE_DEPRECATED bool | ConnectToHost (const TQString &host, unsigned int port, bool sendError) |
KDE_DEPRECATED void | CloseDescriptor () |
KDE_DEPRECATED bool | AtEOF () |
KDE_DEPRECATED bool | InitializeSSL () |
KDE_DEPRECATED void | CleanSSL () |
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) |
void | setBlockSize (int sz) |
unsigned short int | port (unsigned short int _port) |
bool | connectToHost (const TQString &host, unsigned int port, bool sendError=true) |
bool | usingSSL () const |
bool | usingTLS () const |
bool | usingTLS () |
bool | canUseTLS () |
int | startTLS () |
void | stopTLS () |
void | closeDescriptor () |
bool | atEnd () |
void | setSSLMetaData () |
bool | initializeSSL () |
void | cleanSSL () |
bool | isConnectionValid () |
int | connectResult () |
bool | waitForResponse (int t) |
void | setBlockConnection (bool b) |
void | setConnectTimeout (int t) |
bool | isSSLTunnelEnabled () |
void | setEnableSSLTunnel (bool enable) |
void | setRealHost (const TQString &realHost) |
void | doConstructorStuff () |
int | verifyCertificate () |
void | certificatePrompt () |
bool | userAborted () const |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
int | m_iSock |
bool | m_bIsSSL |
unsigned short int | m_iPort |
unsigned short int | m_iDefaultPort |
TQCString | m_sServiceName |
FILE * | fp |
Protected Attributes inherited from TDEIO::SlaveBase | |
UDSEntryList | pendingListEntries |
uint | listEntryCurrentSize |
long | listEntry_sec |
long | listEntry_usec |
Connection * | appconn |
TQString | mPoolSocket |
TQString | mAppSocket |
bool | mConnectedToApp |
Additional Inherited Members | |
Public Types inherited from TDEIO::SlaveBase | |
enum | MessageBoxType { QuestionYesNo = 1 , WarningYesNo = 2 , WarningContinueCancel = 3 , WarningYesNoCancel = 4 , Information = 5 , SSLMessageBox = 6 } |
Static Public Member Functions inherited from TDEIO::SlaveBase | |
static void | sigsegv_handler (int) |
static void | sigpipe_handler (int) |
Public Attributes inherited from TDEIO::SlaveBase | |
TQCString | mProtocol |
Connection * | m_pConnection |
MetaData | mOutgoingMetaData |
MetaData | mIncomingMetaData |
Static Protected Attributes inherited from TDEIO::SlaveBase | |
static long | s_seqNr |
Detailed Description
There are two classes that specifies the protocol between application (job) and tdeioslave.
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 45 of file tcpslavebase.h.
Member Function Documentation
◆ atEnd()
|
protected |
Returns true when end of data is reached.
Definition at line 446 of file tcpslavebase.cpp.
◆ AtEOF()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 94 of file tcpslavebase.h.
◆ canUseTLS()
|
protected |
Can we use TLS?
- Returns
- if so, true is returned. if not, true isn't returned.
Definition at line 524 of file tcpslavebase.cpp.
◆ CleanSSL()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 104 of file tcpslavebase.h.
◆ cleanSSL()
|
protected |
Cleans up all SSL settings.
Definition at line 435 of file tcpslavebase.cpp.
◆ CloseDescriptor()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 89 of file tcpslavebase.h.
◆ closeDescriptor()
|
protected |
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 406 of file tcpslavebase.cpp.
◆ connectResult()
|
protected |
Returns the status of the connection.
This function allows you to invoke ConnectToHost with the sendError
flag set to false so that you can send the appropriate error message back to the calling io-slave.
- Returns
- the status code as returned by KExtendedSocket.
Definition at line 1264 of file tcpslavebase.cpp.
◆ ConnectToHost()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 83 of file tcpslavebase.h.
◆ connectToHost()
|
protected |
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.
- Parameters
-
host hostname port port number to connect to sendError if true sends error message to calling app.
- Returns
- on succes, true is returned. on failure, false is returned and an appropriate error message is send to the application.
Definition at line 302 of file tcpslavebase.cpp.
◆ GetPort()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 78 of file tcpslavebase.h.
◆ InitializeSSL()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 99 of file tcpslavebase.h.
◆ initializeSSL()
|
protected |
Initializs all SSL variables.
Definition at line 424 of file tcpslavebase.cpp.
◆ isConnectionValid()
|
protected |
Determines whether or not we are still connected to the remote machine.
This method may fail to detect a closed SSL connection.
return true
if the socket is still active or false otherwise.
Definition at line 1162 of file tcpslavebase.cpp.
◆ isSSLTunnelEnabled()
|
protected |
Returns true if SSL tunneling is enabled.
- See also
- setEnableSSlTunnel
Definition at line 1279 of file tcpslavebase.cpp.
◆ port()
|
protected |
Determines the appropriate port to use.
This functions attempts to discover the appropriate port.
- Parameters
-
_port the port to try, if it works, it is returned
- Returns
- the default port if the given port doesn't work
Definition at line 284 of file tcpslavebase.cpp.
◆ Read()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 68 of file tcpslavebase.h.
◆ read()
|
protected |
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.
- Parameters
-
data storage for the info read from server len length of the info to read from the server
- Returns
- the actual size of data that was obtained
Definition at line 167 of file tcpslavebase.cpp.
◆ ReadLine()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 73 of file tcpslavebase.h.
◆ readLine()
|
protected |
Same as above except it reads data one line at a time.
Definition at line 192 of file tcpslavebase.cpp.
◆ setBlockConnection()
|
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 1269 of file tcpslavebase.cpp.
◆ setBlockSize()
|
protected |
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 183 of file tcpslavebase.cpp.
◆ setConnectTimeout()
|
protected |
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 ConnectToHost
.
- Parameters
-
t timeout value
Definition at line 1274 of file tcpslavebase.cpp.
◆ setEnableSSLTunnel()
|
protected |
Set up SSL tunneling mode.
Calling this function with a true
argument will allow you to temprarly ignore the m_bIsSSL
flag setting and make a non-SSL connection. It is mostly useful for making connections to SSL sites through a non-transparent proxy server (i.e. most proxy servers out there).
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.
- Parameters
-
enable if true SSL Tunneling will be enabled
Definition at line 1284 of file tcpslavebase.cpp.
◆ setRealHost()
|
protected |
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!
- Parameters
-
realHost the actual host name we are connecting to
Definition at line 1289 of file tcpslavebase.cpp.
◆ setSSLMetaData()
|
protected |
Call this if you use persistent connections and want all the metadata restored.
This is particularly important for SSL sessions since the app needs to know the state of connection, certificates, etc.
Definition at line 516 of file tcpslavebase.cpp.
◆ startTLS()
|
protected |
Start using TLS on the connection.
- Returns
- on success, 1 is returned. on failure, 0 is returned. on TLS init failure, -1 is returned. on connect failure, -2 is returned. on certificate failure, -3 is returned.
Definition at line 451 of file tcpslavebase.cpp.
◆ stopTLS()
|
protected |
Stop using TLS on the connection.
Definition at line 506 of file tcpslavebase.cpp.
◆ usingSSL()
|
inlineprotected |
Are we using SSL?
- Returns
- if so, true is returned. if not, true isn't returned.
- Since
- 3.2
Definition at line 183 of file tcpslavebase.h.
◆ usingTLS() [1/2]
|
protected |
- Deprecated:
- kept for binary compatibility Are we using TLS?
- Returns
- if so, true is returned. if not, true isn't returned.
Definition at line 729 of file tcpslavebase.cpp.
◆ usingTLS() [2/2]
|
protected |
Are we using TLS?
- Returns
- if so, true is returned. if not, true isn't returned.
- Since
- 3.2
Definition at line 723 of file tcpslavebase.cpp.
◆ waitForResponse()
|
protected |
Wait for some type of activity 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 activity was seen on the socket before the timeout value was reached, false otherwise.
Definition at line 1215 of file tcpslavebase.cpp.
◆ Write()
|
inlineprotected |
- Deprecated:
- Due to inconsistency with KDE naming convention.
Definition at line 63 of file tcpslavebase.h.
◆ write()
|
protected |
This function acts like standard write function call except it is also capable of making SSL or SOCKS connections.
- Parameters
-
data info to be sent to remote machine len the length of the data to be sent
- Returns
- the actual size of the data that was sent
Definition at line 152 of file tcpslavebase.cpp.
The documentation for this class was generated from the following files: