• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • KIO
  • TCPSlaveBase
Public Member Functions | Protected Types | Protected Member Functions
KIO::TCPSlaveBase Class Reference

#include <tcpslavebase.h>

Inheritance diagram for KIO::TCPSlaveBase:
Inheritance graph
[legend]

List of all members.

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.

Definition at line 46 of file tcpslavebase.h.


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:
autoSslif 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 188 of file tcpslavebase.cpp.

TCPSlaveBase::~TCPSlaveBase ( ) [virtual]

Definition at line 208 of file tcpslavebase.cpp.


Member Function Documentation

bool TCPSlaveBase::atEnd ( ) const [protected]

Returns true when end of data is reached.

Definition at line 438 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:
protocolthe protocol being used
hosthostname
portport 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 296 of file tcpslavebase.cpp.

int TCPSlaveBase::connectToHost ( const QString &  host,
quint16  port,
QString *  errorString = 0 
) [protected]

Connects to the specified host and port.

Parameters:
hosthost name
portport number
errorStringif not NULL, this string will contain error information on why the connection request failed.
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 309 of file tcpslavebase.cpp.

void TCPSlaveBase::disconnectFromHost ( ) [protected]

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

Definition at line 400 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 423 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 974 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 428 of file tcpslavebase.cpp.

quint16 TCPSlaveBase::port ( ) const [protected]

the current port for this service

  

Definition at line 433 of file tcpslavebase.cpp.

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

Definition at line 246 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 272 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:
btrue to make the connection a blocking one, false otherwise.

Definition at line 989 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 182 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 443 of file tcpslavebase.cpp.

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

Reimplemented from KIO::SlaveBase.

Definition at line 998 of file tcpslavebase.cpp.

bool TCPSlaveBase::waitForResponse ( int  t) [protected]

Wait for incoming data on the socket for the period specified by t.

Parameters:
tlength 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 981 of file tcpslavebase.cpp.

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

Definition at line 214 of file tcpslavebase.cpp.


The documentation for this class was generated from the following files:
  • tcpslavebase.h
  • tcpslavebase.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 20:55:30 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs-4.8.3 API Reference

Skip menu "kdelibs-4.8.3 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal