• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

KIO::TCPSlaveBase

KIO::TCPSlaveBase Class Reference

#include <tcpslavebase.h>

Inheritance diagram for KIO::TCPSlaveBase:

Inheritance graph
[legend]

List of all members.


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.


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)
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)

Member Enumeration Documentation

enum KIO::TCPSlaveBase::SslResultDetail [protected]

Enumerator:
ResultOk 
ResultOverridden 
ResultFailed 
ResultFailedEarly 

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 136 of file tcpslavebase.cpp.

TCPSlaveBase::~TCPSlaveBase (  )  [virtual]

Definition at line 153 of file tcpslavebase.cpp.


Member Function Documentation

bool TCPSlaveBase::atEnd (  )  const [protected]

Returns true when end of data is reached.

Definition at line 362 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.

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:
protocol the protocol being used
host hostname
port port number
sendError if true sends error message to calling app on error.
Returns:
on succes, true is returned. on failure, false is returned and an appropriate error message is sent to the application.

Definition at line 243 of file tcpslavebase.cpp.

void TCPSlaveBase::disconnectFromHost (  )  [protected]

Close the connection and forget non-permanent data like the peer host.

Definition at line 328 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 347 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 865 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 352 of file tcpslavebase.cpp.

quint16 TCPSlaveBase::port (  )  const [protected]

the current port for this service

Definition at line 357 of file tcpslavebase.cpp.

ssize_t TCPSlaveBase::read ( char *  data,
ssize_t  len 
) [protected]

Definition at line 191 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 211 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 880 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 130 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 367 of file tcpslavebase.cpp.

void TCPSlaveBase::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Reimplemented from KIO::SlaveBase.

Definition at line 885 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 872 of file tcpslavebase.cpp.

ssize_t TCPSlaveBase::write ( const char *  data,
ssize_t  len 
) [protected]

Definition at line 159 of file tcpslavebase.cpp.


The documentation for this class was generated from the following files:
  • tcpslavebase.h
  • tcpslavebase.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal