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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
tcpslavebase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000 Alex Zepeda <zipzippy@sonic.net>
3  * Copyright (C) 2001 George Staikos <staikos@kde.org>
4  * Copyright (C) 2001 Dawit Alemayehu <adawit@kde.org>
5  * Copyright (C) 2007,2008 Andreas Hartmetz <ahartmetz@gmail.com>
6  *
7  * This file is part of the KDE project
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public License
20  * along with this library; see the file COPYING.LIB. If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  */
24 
25 #ifndef _TCP_SLAVEBASE_H
26 #define _TCP_SLAVEBASE_H
27 
28 #include <sys/types.h>
29 #include <stdio.h>
30 
31 #include <kio/slavebase.h>
32 
33 class QIODevice;
34 
35 namespace KIO {
36 
46 class KIO_EXPORT TCPSlaveBase : public SlaveBase
47 {
48 public:
56  TCPSlaveBase(const QByteArray &protocol,
57  const QByteArray &poolSocket, const QByteArray &appSocket,
58  bool autoSsl = false);
59 
60  virtual ~TCPSlaveBase();
61 
62 protected:
63  enum SslResultDetail {
64  ResultOk = 1,
65  ResultOverridden = 2,
66  ResultFailed = 4,
67  ResultFailedEarly = 8
68  };
69  friend class QFlags<KIO::TCPSlaveBase::SslResultDetail>;
70 public:
71  Q_DECLARE_FLAGS(SslResult, SslResultDetail)
72 protected:
73 
82  using SlaveBase::write; //Silence incompatible virtual override warning
83  ssize_t write(const char *data, ssize_t len);
84 
93  using SlaveBase::read;
94  ssize_t read(char *data, ssize_t len);
95 
99  ssize_t readLine(char *data, ssize_t len);
100 
113  bool connectToHost(const QString &protocol, const QString& host, quint16 port);
114 
129  int connectToHost(const QString& host, quint16 port, QString* errorString = 0);
130 
135  quint16 port() const;
136 
143  bool isAutoSsl() const;
144 
151  bool isUsingSsl() const;
152 
161  bool startSsl();
162 
166  void disconnectFromHost();
167 
171  bool atEnd() const;
172 
180  bool isConnected() const;
181 
192  bool waitForResponse( int t );
193 
203  void setBlocking( bool b );
204 
208  QIODevice *socket() const;
209 
210 protected:
211  virtual void virtual_hook( int id, void* data );
212 
213 private:
214  // For the certificate verification code
215  SslResult verifyServerCertificate();
216 
217  // For prompting for the client certificate to use
218  void selectClientCertificate();
219 
220  class TcpSlaveBasePrivate;
221  TcpSlaveBasePrivate* const d;
222 };
223 
224 }
225 
226 #endif
QIODevice
QByteArray
KIO::SlaveBase::write
virtual void write(const QByteArray &data)
Definition: slavebase.cpp:774
QFlags
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:50
connectToHost
QTcpSocket * connectToHost(const QString &protocol, const QString &host, quint16 port, QObject *parent=0)
KIO::TCPSlaveBase::SslResultDetail
SslResultDetail
Definition: tcpslavebase.h:63
KIO::SlaveBase::read
virtual void read(KIO::filesize_t size)
Definition: slavebase.cpp:772
KIO::TCPSlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: tcpslavebase.h:46
bool
slavebase.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:54 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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