.TH "KIO::TCPSlaveBase" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KIO::TCPSlaveBase \- There are two classes that specifies the protocol between application (job) and kioslave.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <tcpslavebase.h>\fP
.PP
Inherits \fBKIO::SlaveBase\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBTCPSlaveBase\fP (unsigned short int defaultPort, const \fBQCString\fP &protocol, const \fBQCString\fP &poolSocket, const \fBQCString\fP &appSocket)"
.br
.ti -1c
.RI "\fBTCPSlaveBase\fP (unsigned short int defaultPort, const \fBQCString\fP &protocol, const \fBQCString\fP &poolSocket, const \fBQCString\fP &appSocket, bool useSSL)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "KDE_DEPRECATED ssize_t \fBWrite\fP (const void *data, ssize_t len)"
.br
.ti -1c
.RI "KDE_DEPRECATED ssize_t \fBRead\fP (void *data, ssize_t len)"
.br
.ti -1c
.RI "KDE_DEPRECATED ssize_t \fBReadLine\fP (char *data, ssize_t len)"
.br
.ti -1c
.RI "KDE_DEPRECATED unsigned short int \fBGetPort\fP (unsigned short int p)"
.br
.ti -1c
.RI "KDE_DEPRECATED bool \fBConnectToHost\fP (const \fBQString\fP &host, unsigned int port, bool sendError)"
.br
.ti -1c
.RI "KDE_DEPRECATED void \fBCloseDescriptor\fP ()"
.br
.ti -1c
.RI "KDE_DEPRECATED bool \fBAtEOF\fP ()"
.br
.ti -1c
.RI "KDE_DEPRECATED bool \fBInitializeSSL\fP ()"
.br
.ti -1c
.RI "KDE_DEPRECATED void \fBCleanSSL\fP ()"
.br
.ti -1c
.RI "ssize_t \fBwrite\fP (const void *data, ssize_t len)"
.br
.ti -1c
.RI "ssize_t \fBread\fP (void *data, ssize_t len)"
.br
.ti -1c
.RI "ssize_t \fBreadLine\fP (char *data, ssize_t len)"
.br
.ti -1c
.RI "void \fBsetBlockSize\fP (int sz)"
.br
.ti -1c
.RI "unsigned short int \fBport\fP (unsigned short int _port)"
.br
.ti -1c
.RI "bool \fBconnectToHost\fP (const \fBQString\fP &host, unsigned int port, bool sendError=true)"
.br
.ti -1c
.RI "bool \fBusingSSL\fP () const "
.br
.ti -1c
.RI "bool \fBusingTLS\fP () const "
.br
.ti -1c
.RI "bool \fBusingTLS\fP ()"
.br
.ti -1c
.RI "bool \fBcanUseTLS\fP ()"
.br
.ti -1c
.RI "int \fBstartTLS\fP ()"
.br
.ti -1c
.RI "void \fBstopTLS\fP ()"
.br
.ti -1c
.RI "void \fBcloseDescriptor\fP ()"
.br
.ti -1c
.RI "bool \fBatEnd\fP ()"
.br
.ti -1c
.RI "void \fBsetSSLMetaData\fP ()"
.br
.ti -1c
.RI "bool \fBinitializeSSL\fP ()"
.br
.ti -1c
.RI "void \fBcleanSSL\fP ()"
.br
.ti -1c
.RI "bool \fBisConnectionValid\fP ()"
.br
.ti -1c
.RI "int \fBconnectResult\fP ()"
.br
.ti -1c
.RI "bool \fBwaitForResponse\fP (int t)"
.br
.ti -1c
.RI "void \fBsetBlockConnection\fP (bool b)"
.br
.ti -1c
.RI "void \fBsetConnectTimeout\fP (int t)"
.br
.ti -1c
.RI "bool \fBisSSLTunnelEnabled\fP ()"
.br
.ti -1c
.RI "void \fBsetEnableSSLTunnel\fP (bool enable)"
.br
.ti -1c
.RI "void \fBsetRealHost\fP (const \fBQString\fP &realHost)"
.br
.ti -1c
.RI "void \fBdoConstructorStuff\fP ()"
.br
.ti -1c
.RI "int \fBverifyCertificate\fP ()"
.br
.ti -1c
.RI "void \fBcertificatePrompt\fP ()"
.br
.ti -1c
.RI "bool \fBuserAborted\fP () const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "int \fBm_iSock\fP"
.br
.ti -1c
.RI "bool \fBm_bIsSSL\fP"
.br
.ti -1c
.RI "unsigned short int \fBm_iPort\fP"
.br
.ti -1c
.RI "unsigned short int \fBm_iDefaultPort\fP"
.br
.ti -1c
.RI "\fBQCString\fP \fBm_sServiceName\fP"
.br
.ti -1c
.RI "FILE * \fBfp\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
There are two classes that specifies the protocol between application (job) and kioslave. 

\fBSlaveInterface\fP is the class to use on the application end, \fBSlaveBase\fP is the one to use on the slave end.
.PP
Slave implementations should simply inherit \fBSlaveBase\fP
.PP
A call to foo() results in a call to slotFoo() on the other end. 
.PP
Definition at line 45 of file tcpslavebase.h.
.SH "Member Function Documentation"
.PP 
.SS "KDE_DEPRECATED ssize_t KIO::TCPSlaveBase::Write (const void * data, ssize_t len)\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 63 of file tcpslavebase.h.
.SS "KDE_DEPRECATED ssize_t KIO::TCPSlaveBase::Read (void * data, ssize_t len)\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 68 of file tcpslavebase.h.
.SS "KDE_DEPRECATED ssize_t KIO::TCPSlaveBase::ReadLine (char * data, ssize_t len)\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 73 of file tcpslavebase.h.
.SS "KDE_DEPRECATED unsigned short int KIO::TCPSlaveBase::GetPort (unsigned short int p)\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 78 of file tcpslavebase.h.
.SS "KDE_DEPRECATED bool KIO::TCPSlaveBase::ConnectToHost (const \fBQString\fP & host, unsigned int port, bool sendError)\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 83 of file tcpslavebase.h.
.SS "KDE_DEPRECATED void KIO::TCPSlaveBase::CloseDescriptor ()\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 89 of file tcpslavebase.h.
.SS "KDE_DEPRECATED bool KIO::TCPSlaveBase::AtEOF ()\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 94 of file tcpslavebase.h.
.SS "KDE_DEPRECATED bool KIO::TCPSlaveBase::InitializeSSL ()\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 99 of file tcpslavebase.h.
.SS "KDE_DEPRECATED void KIO::TCPSlaveBase::CleanSSL ()\fC [inline, protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Due to inconsistency with \fBKDE\fP naming convention. 
.RE
.PP

.PP
Definition at line 104 of file tcpslavebase.h.
.SS "ssize_t KIO::TCPSlaveBase::write (const void * data, ssize_t len)\fC [protected]\fP"
.PP
This function acts like standard write function call except it is also capable of making SSL or SOCKS connections. 
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP info to be sent to remote machine 
.br
\fIlen\fP the length of the data to be sent
.RE
.PP
\fBReturns:\fP
.RS 4
the actual size of the data that was sent 
.RE
.PP

.SS "ssize_t KIO::TCPSlaveBase::read (void * data, ssize_t len)\fC [protected]\fP"
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP storage for the info read from server 
.br
\fIlen\fP lenght of the info to read from the server
.RE
.PP
\fBReturns:\fP
.RS 4
the actual size of data that was obtained 
.RE
.PP

.SS "ssize_t KIO::TCPSlaveBase::readLine (char * data, ssize_t len)\fC [protected]\fP"
.PP
Same as above except it reads data one line at a time. 
.PP
.SS "void KIO::TCPSlaveBase::setBlockSize (int sz)\fC [protected]\fP"
.PP
Sets the maximum size of blocks read in during calls to \fBreadLine()\fP. 
.PP
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) 
.SS "unsigned short int KIO::TCPSlaveBase::port (unsigned short int _port)\fC [protected]\fP"
.PP
Determines the appropriate port to use. 
.PP
This functions attempts to discover the appropriate port.
.PP
\fBParameters:\fP
.RS 4
\fI_port\fP the port to try, if it works, it is returned 
.RE
.PP
\fBReturns:\fP
.RS 4
the default port if the given port doesn't work 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::connectToHost (const \fBQString\fP & host, unsigned int port, bool sendError = \fCtrue\fP)\fC [protected]\fP"
.PP
Performs the initial TCP connection stuff and/or SSL handshaking as necessary. 
.PP
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 \fBconnectResult()\fP function to determine the result of the request for connection.
.PP
\fBParameters:\fP
.RS 4
\fIhost\fP hostname 
.br
\fIport\fP port number 
.br
\fIsendError\fP if true sends error message to calling app.
.RE
.PP
\fBReturns:\fP
.RS 4
on succes, true is returned. on failure, false is returned and an appropriate error message is send to the application. 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::usingSSL () const\fC [inline, protected]\fP"
.PP
Are we using SSL? 
.PP
\fBReturns:\fP
.RS 4
if so, true is returned. if not, true isn't returned. 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 183 of file tcpslavebase.h.
.SS "bool KIO::TCPSlaveBase::usingTLS () const\fC [protected]\fP"
.PP
Are we using TLS? 
.PP
\fBReturns:\fP
.RS 4
if so, true is returned. if not, true isn't returned. 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::usingTLS ()\fC [protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
kept for binary compatibility Are we using TLS? 
.RE
.PP
\fBReturns:\fP
.RS 4
if so, true is returned. if not, true isn't returned. 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::canUseTLS ()\fC [protected]\fP"
.PP
Can we use TLS? 
.PP
\fBReturns:\fP
.RS 4
if so, true is returned. if not, true isn't returned. 
.RE
.PP

.SS "int KIO::TCPSlaveBase::startTLS ()\fC [protected]\fP"
.PP
Start using TLS on the connection. 
.PP
\fBReturns:\fP
.RS 4
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. 
.RE
.PP

.SS "void KIO::TCPSlaveBase::stopTLS ()\fC [protected]\fP"
.PP
Stop using TLS on the connection. 
.PP
.SS "void KIO::TCPSlaveBase::closeDescriptor ()\fC [protected]\fP"
.PP
Closes the current file descriptor. 
.PP
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 
.SS "bool KIO::TCPSlaveBase::atEnd ()\fC [protected]\fP"
.PP
Returns true when end of data is reached. 
.PP
.SS "void KIO::TCPSlaveBase::setSSLMetaData ()\fC [protected]\fP"
.PP
Call this if you use persistent connections and want all the metadata restored. 
.PP
This is particularly important for SSL sessions since the app needs to know the state of connection, certificates, etc. 
.SS "bool KIO::TCPSlaveBase::initializeSSL ()\fC [protected]\fP"
.PP
Initializs all SSL variables. 
.PP
.SS "void KIO::TCPSlaveBase::cleanSSL ()\fC [protected]\fP"
.PP
Cleans up all SSL settings. 
.PP
.SS "bool KIO::TCPSlaveBase::isConnectionValid ()\fC [protected]\fP"
.PP
Determines whether or not we are still connected to the remote machine. 
.PP
This method may fail to detect a closed SSL connection.
.PP
return \fCtrue\fP if the socket is still active or false otherwise. 
.SS "int KIO::TCPSlaveBase::connectResult ()\fC [protected]\fP"
.PP
Returns the status of the connection. 
.PP
This function allows you to invoke ConnectToHost with the \fCsendError\fP flag set to false so that you can send the appropriate error message back to the calling io-slave.
.PP
\fBReturns:\fP
.RS 4
the status code as returned by KExtendedSocket. 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::waitForResponse (int t)\fC [protected]\fP"
.PP
Wait for some type of activity on the socket for the period specified by \fCt\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIt\fP length of time in seconds that we should monitor the socket before timing out.
.RE
.PP
\fBReturns:\fP
.RS 4
true if any activity was seen on the socket before the timeout value was reached, false otherwise. 
.RE
.PP

.SS "void KIO::TCPSlaveBase::setBlockConnection (bool b)\fC [protected]\fP"
.PP
Sets the mode of the connection to blocking or non-blocking. 
.PP
Be sure to call this function before calling connectToHost. Otherwise, this setting will not have any effect until the next \fCconnectToHost\fP.
.PP
\fBParameters:\fP
.RS 4
\fIb\fP true to make the connection a blocking one, false otherwise. 
.RE
.PP

.SS "void KIO::TCPSlaveBase::setConnectTimeout (int t)\fC [protected]\fP"
.PP
Sets how long to wait for orignally connecting to the requested before timinig out. 
.PP
Be sure to call this function before calling ConnectToHost, otherwise the setting will not take effect until the next call to \fCConnectToHost\fP.
.PP
\fBParameters:\fP
.RS 4
\fIt\fP timeout value 
.RE
.PP

.SS "bool KIO::TCPSlaveBase::isSSLTunnelEnabled ()\fC [protected]\fP"
.PP
Returns true if SSL tunneling is enabled. 
.PP
\fBSee also:\fP
.RS 4
setEnableSSlTunnel 
.RE
.PP

.SS "void KIO::TCPSlaveBase::setEnableSSLTunnel (bool enable)\fC [protected]\fP"
.PP
Set up SSL tunneling mode. 
.PP
Calling this function with a \fCtrue\fP argument will allow you to temprarly ignore the \fCm_bIsSSL\fP 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).
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP if true SSL Tunneling will be enabled 
.RE
.PP

.SS "void KIO::TCPSlaveBase::setRealHost (const \fBQString\fP & realHost)\fC [protected]\fP"
.PP
Sets up the the real hostname for an SSL connection that goes through a proxy server. 
.PP
This function is essential in making sure that the real hostname is used for validating certificates from SSL sites!
.PP
\fBParameters:\fP
.RS 4
\fIrealHost\fP the actual host name we are connecting to 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
