KDECore
#include <ktcpsocket.h>
Public Types | |
enum | EncryptionMode { UnencryptedMode = 0, SslClientMode, SslServerMode } |
enum | Error { UnknownError = 0, ConnectionRefusedError, RemoteHostClosedError, HostNotFoundError, SocketAccessError, SocketResourceError, SocketTimeoutError, NetworkError, UnsupportedSocketOperationError, SslHandshakeFailedError } |
enum | ProxyPolicy { AutoProxy = 0, ManualProxy } |
enum | SslVersion { UnknownSslVersion = 0x01, SslV2 = 0x02, SslV3 = 0x04, TlsV1 = 0x08, SslV3_1 = 0x08, TlsV1SslV3 = 0x10, SecureProtocols = 0x20, AnySslVersion = SslV2 | SslV3 | TlsV1 } |
enum | State { UnconnectedState = 0, HostLookupState, ConnectingState, ConnectedState, BoundState, ListeningState, ClosingState } |
Public Slots | |
void | ignoreSslErrors () |
void | startClientEncryption () |
Signals | |
void | connected () |
void | disconnected () |
void | encrypted () |
void | encryptedBytesWritten (qint64 written) |
void | encryptionModeChanged (EncryptionMode) |
void | error (KTcpSocket::Error) |
void | hostFound () |
void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator) |
void | sslErrors (const QList< KSslError > &errors) |
void | stateChanged (KTcpSocket::State) |
Public Member Functions | |
KTcpSocket (QObject *parent=0) | |
~KTcpSocket () | |
void | abort () |
void | addCaCertificate (const QSslCertificate &certificate) |
void | addCaCertificates (const QList< QSslCertificate > &certificates) |
SslVersion | advertisedSslVersion () const |
virtual bool | atEnd () const |
virtual qint64 | bytesAvailable () const |
virtual qint64 | bytesToWrite () const |
QList< QSslCertificate > | caCertificates () const |
virtual bool | canReadLine () const |
QList< KSslCipher > | ciphers () const |
virtual void | close () |
void | connectToHost (const QString &hostName, quint16 port, ProxyPolicy policy=AutoProxy) |
void | connectToHost (const QHostAddress &hostAddress, quint16 port, ProxyPolicy policy=AutoProxy) |
void | connectToHost (const KUrl &url, ProxyPolicy policy=AutoProxy) |
void | connectToHostEncrypted (const QString &hostName, quint16 port, OpenMode openMode=ReadWrite) |
void | disconnectFromHost () |
EncryptionMode | encryptionMode () const |
Error | error () const |
bool | flush () |
virtual bool | isSequential () const |
bool | isValid () const |
QHostAddress | localAddress () const |
QSslCertificate | localCertificate () const |
SslVersion | negotiatedSslVersion () const |
QString | negotiatedSslVersionName () const |
virtual bool | open (QIODevice::OpenMode open) |
QHostAddress | peerAddress () const |
QList< QSslCertificate > | peerCertificateChain () const |
QString | peerName () const |
quint16 | peerPort () const |
KSslKey | privateKey () const |
QNetworkProxy | proxy () const |
qint64 | readBufferSize () const |
KSslCipher | sessionCipher () const |
void | setAdvertisedSslVersion (SslVersion version) |
void | setCaCertificates (const QList< QSslCertificate > &certificates) |
void | setCiphers (const QList< KSslCipher > &ciphers) |
void | setLocalCertificate (const QSslCertificate &certificate) |
void | setLocalCertificate (const QString &fileName, QSsl::EncodingFormat format=QSsl::Pem) |
void | setPrivateKey (const KSslKey &key) |
void | setPrivateKey (const QString &fileName, KSslKey::Algorithm algorithm=KSslKey::Rsa, QSsl::EncodingFormat format=QSsl::Pem, const QByteArray &passPhrase=QByteArray()) |
void | setProxy (const QNetworkProxy &proxy) |
void | setReadBufferSize (qint64 size) |
void | setSocketOption (QAbstractSocket::SocketOption options, const QVariant &value) |
void | setSslConfiguration (const QSslConfiguration &configuration) |
void | setVerificationPeerName (const QString &hostName) |
QVariant | socketOption (QAbstractSocket::SocketOption options) const |
QSslConfiguration | sslConfiguration () const |
QList< KSslError > | sslErrors () const |
State | state () const |
virtual bool | waitForBytesWritten (int msecs) |
bool | waitForConnected (int msecs=30000) |
bool | waitForDisconnected (int msecs=30000) |
bool | waitForEncrypted (int msecs=30000) |
virtual bool | waitForReadyRead (int msecs=30000) |
Public Member Functions inherited from QIODevice | |
QIODevice () | |
QIODevice (QObject *parent) | |
virtual | ~QIODevice () |
void | aboutToClose () |
Offset | at () const |
bool | at (Offset offset) |
void | bytesWritten (qint64 bytes) |
QString | errorString () const |
int | flags () const |
int | getch () |
bool | getChar (char *c) |
bool | isAsynchronous () const |
bool | isBuffered () const |
bool | isCombinedAccess () const |
bool | isDirectAccess () const |
bool | isInactive () const |
bool | isOpen () const |
bool | isRaw () const |
bool | isReadable () const |
bool | isSequentialAccess () const |
bool | isSynchronous () const |
bool | isTextModeEnabled () const |
bool | isTranslated () const |
bool | isWritable () const |
int | mode () const |
virtual bool | open (QFlags< QIODevice::OpenModeFlag > mode) |
OpenMode | openMode () const |
qint64 | peek (char *data, qint64 maxSize) |
QByteArray | peek (qint64 maxSize) |
virtual qint64 | pos () const |
int | putch (int ch) |
bool | putChar (char c) |
qint64 | read (char *data, qint64 maxSize) |
QByteArray | read (qint64 maxSize) |
QByteArray | readAll () |
qint64 | readBlock (char *data, quint64 size) |
void | readChannelFinished () |
QByteArray | readLine (qint64 maxSize) |
qint64 | readLine (char *data, qint64 maxSize) |
void | readyRead () |
virtual bool | reset () |
void | resetStatus () |
virtual bool | seek (qint64 pos) |
void | setTextModeEnabled (bool enabled) |
virtual qint64 | size () const |
int | state () const |
Status | status () const |
int | ungetch (int ch) |
void | ungetChar (char c) |
qint64 | write (const char *data) |
qint64 | write (const char *data, qint64 maxSize) |
qint64 | write (const QByteArray &byteArray) |
qint64 | writeBlock (const QByteArray &data) |
qint64 | writeBlock (const char *data, quint64 size) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Member Functions | |
virtual qint64 | readData (char *data, qint64 maxSize) |
virtual qint64 | writeData (const char *data, qint64 maxSize) |
Protected Member Functions inherited from QIODevice | |
virtual qint64 | readData (char *data, qint64 maxSize)=0 |
virtual qint64 | readLineData (char *data, qint64 maxSize) |
void | setErrorString (const QString &str) |
void | setOpenMode (QFlags< QIODevice::OpenModeFlag > openMode) |
virtual qint64 | writeData (const char *data, qint64 maxSize)=0 |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Public Attributes inherited from QIODevice | |
typedef | Offset |
typedef | OpenMode |
typedef | Status |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
Definition at line 144 of file ktcpsocket.h.
Member Enumeration Documentation
Enumerator | |
---|---|
UnencryptedMode | |
SslClientMode | |
SslServerMode |
Definition at line 213 of file ktcpsocket.h.
enum KTcpSocket::Error |
Definition at line 169 of file ktcpsocket.h.
Enumerator | |
---|---|
AutoProxy |
Use the proxy that KProtocolManager suggests for the connection parameters given. |
ManualProxy |
Use the proxy set by setProxy(), if any; otherwise use no proxy. |
Definition at line 218 of file ktcpsocket.h.
Enumerator | |
---|---|
UnknownSslVersion | |
SslV2 | |
SslV3 | |
TlsV1 | |
SslV3_1 | |
TlsV1SslV3 | |
SecureProtocols | |
AnySslVersion |
Definition at line 158 of file ktcpsocket.h.
enum KTcpSocket::State |
Enumerator | |
---|---|
UnconnectedState | |
HostLookupState | |
ConnectingState | |
ConnectedState | |
BoundState | |
ListeningState | |
ClosingState |
Definition at line 148 of file ktcpsocket.h.
Constructor & Destructor Documentation
KTcpSocket::KTcpSocket | ( | QObject * | parent = 0 | ) |
Definition at line 395 of file ktcpsocket.cpp.
KTcpSocket::~KTcpSocket | ( | ) |
Definition at line 424 of file ktcpsocket.cpp.
Member Function Documentation
void KTcpSocket::abort | ( | ) |
Definition at line 501 of file ktcpsocket.cpp.
void KTcpSocket::addCaCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 657 of file ktcpsocket.cpp.
void KTcpSocket::addCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 674 of file ktcpsocket.cpp.
KTcpSocket::SslVersion KTcpSocket::advertisedSslVersion | ( | ) | const |
Definition at line 857 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 431 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 437 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 443 of file ktcpsocket.cpp.
QList< QSslCertificate > KTcpSocket::caCertificates | ( | ) | const |
Definition at line 681 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 449 of file ktcpsocket.cpp.
QList< KSslCipher > KTcpSocket::ciphers | ( | ) | const |
Definition at line 688 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 455 of file ktcpsocket.cpp.
|
signal |
void KTcpSocket::connectToHost | ( | const QString & | hostName, |
quint16 | port, | ||
ProxyPolicy | policy = AutoProxy |
||
) |
Definition at line 507 of file ktcpsocket.cpp.
void KTcpSocket::connectToHost | ( | const QHostAddress & | hostAddress, |
quint16 | port, | ||
ProxyPolicy | policy = AutoProxy |
||
) |
Definition at line 523 of file ktcpsocket.cpp.
void KTcpSocket::connectToHost | ( | const KUrl & | url, |
ProxyPolicy | policy = AutoProxy |
||
) |
Take the hostname and port from url
and connect to them.
The information from a full URL enables the most accurate choice of proxy in case of proxy rules that depend on high-level information like protocol or username.
- See also
- KProtocolManager::proxyForUrl()
Definition at line 533 of file ktcpsocket.cpp.
void KTcpSocket::connectToHostEncrypted | ( | const QString & | hostName, |
quint16 | port, | ||
OpenMode | openMode = ReadWrite |
||
) |
Definition at line 694 of file ktcpsocket.cpp.
|
signal |
void KTcpSocket::disconnectFromHost | ( | ) |
Definition at line 543 of file ktcpsocket.cpp.
|
signal |
|
signal |
- Since
- 4.8.1 Forwarded from QSslSocket
KTcpSocket::EncryptionMode KTcpSocket::encryptionMode | ( | ) | const |
Definition at line 802 of file ktcpsocket.cpp.
|
signal |
KTcpSocket::Error KTcpSocket::error | ( | ) | const |
Definition at line 550 of file ktcpsocket.cpp.
|
signal |
bool KTcpSocket::flush | ( | ) |
Definition at line 568 of file ktcpsocket.cpp.
|
signal |
|
slot |
Definition at line 828 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 462 of file ktcpsocket.cpp.
bool KTcpSocket::isValid | ( | ) | const |
Definition at line 574 of file ktcpsocket.cpp.
QHostAddress KTcpSocket::localAddress | ( | ) | const |
Definition at line 580 of file ktcpsocket.cpp.
QSslCertificate KTcpSocket::localCertificate | ( | ) | const |
Definition at line 703 of file ktcpsocket.cpp.
KTcpSocket::SslVersion KTcpSocket::negotiatedSslVersion | ( | ) | const |
Definition at line 863 of file ktcpsocket.cpp.
QString KTcpSocket::negotiatedSslVersionName | ( | ) | const |
Definition at line 872 of file ktcpsocket.cpp.
|
virtual |
Definition at line 468 of file ktcpsocket.cpp.
QHostAddress KTcpSocket::peerAddress | ( | ) | const |
Definition at line 586 of file ktcpsocket.cpp.
QList< QSslCertificate > KTcpSocket::peerCertificateChain | ( | ) | const |
Definition at line 709 of file ktcpsocket.cpp.
QString KTcpSocket::peerName | ( | ) | const |
Definition at line 592 of file ktcpsocket.cpp.
quint16 KTcpSocket::peerPort | ( | ) | const |
Definition at line 598 of file ktcpsocket.cpp.
KSslKey KTcpSocket::privateKey | ( | ) | const |
Definition at line 715 of file ktcpsocket.cpp.
QNetworkProxy KTcpSocket::proxy | ( | ) | const |
- See also
- : connectToHost()
Definition at line 605 of file ktcpsocket.cpp.
|
signal |
qint64 KTcpSocket::readBufferSize | ( | ) | const |
Definition at line 611 of file ktcpsocket.cpp.
Definition at line 488 of file ktcpsocket.cpp.
KSslCipher KTcpSocket::sessionCipher | ( | ) | const |
Definition at line 721 of file ktcpsocket.cpp.
void KTcpSocket::setAdvertisedSslVersion | ( | KTcpSocket::SslVersion | version | ) |
Definition at line 851 of file ktcpsocket.cpp.
void KTcpSocket::setCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 727 of file ktcpsocket.cpp.
void KTcpSocket::setCiphers | ( | const QList< KSslCipher > & | ciphers | ) |
Definition at line 734 of file ktcpsocket.cpp.
void KTcpSocket::setLocalCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 745 of file ktcpsocket.cpp.
void KTcpSocket::setLocalCertificate | ( | const QString & | fileName, |
QSsl::EncodingFormat | format = QSsl::Pem |
||
) |
Definition at line 751 of file ktcpsocket.cpp.
void KTcpSocket::setPrivateKey | ( | const KSslKey & | key | ) |
Definition at line 767 of file ktcpsocket.cpp.
void KTcpSocket::setPrivateKey | ( | const QString & | fileName, |
KSslKey::Algorithm | algorithm = KSslKey::Rsa , |
||
QSsl::EncodingFormat | format = QSsl::Pem , |
||
const QByteArray & | passPhrase = QByteArray() |
||
) |
Definition at line 782 of file ktcpsocket.cpp.
void KTcpSocket::setProxy | ( | const QNetworkProxy & | proxy | ) |
- See also
- : connectToHost()
Definition at line 618 of file ktcpsocket.cpp.
void KTcpSocket::setReadBufferSize | ( | qint64 | size | ) |
Definition at line 624 of file ktcpsocket.cpp.
void KTcpSocket::setSocketOption | ( | QAbstractSocket::SocketOption | options, |
const QVariant & | value | ||
) |
Sets the socket option
to value
.
- See also
- QAbstractSocket::setSocketOption
- Since
- 4.5.0
Definition at line 812 of file ktcpsocket.cpp.
void KTcpSocket::setSslConfiguration | ( | const QSslConfiguration & | configuration | ) |
void KTcpSocket::setVerificationPeerName | ( | const QString & | hostName | ) |
Definition at line 757 of file ktcpsocket.cpp.
QVariant KTcpSocket::socketOption | ( | QAbstractSocket::SocketOption | options | ) | const |
Returns the state of the socket option
.
- See also
- QAbstractSocket::socketOption
- Since
- 4.5.0
Definition at line 807 of file ktcpsocket.cpp.
QSslConfiguration KTcpSocket::sslConfiguration | ( | ) | const |
Definition at line 556 of file ktcpsocket.cpp.
|
slot |
Definition at line 835 of file ktcpsocket.cpp.
KTcpSocket::State KTcpSocket::state | ( | ) | const |
Definition at line 630 of file ktcpsocket.cpp.
|
signal |
|
virtual |
Reimplemented from QIODevice.
Definition at line 476 of file ktcpsocket.cpp.
bool KTcpSocket::waitForConnected | ( | int | msecs = 30000 | ) |
Definition at line 636 of file ktcpsocket.cpp.
bool KTcpSocket::waitForDisconnected | ( | int | msecs = 30000 | ) |
Definition at line 646 of file ktcpsocket.cpp.
bool KTcpSocket::waitForEncrypted | ( | int | msecs = 30000 | ) |
Definition at line 796 of file ktcpsocket.cpp.
|
virtual |
Reimplemented from QIODevice.
Definition at line 482 of file ktcpsocket.cpp.
Definition at line 494 of file ktcpsocket.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.