KDECore
#include <ktcpsocket.h>
|
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
} |
|
|
| 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 KUrl &url, ProxyPolicy policy=AutoProxy) |
|
void | connectToHost (const QHostAddress &hostAddress, quint16 port, ProxyPolicy policy=AutoProxy) |
|
void | connectToHost (const QString &hostName, quint16 port, 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) |
|
Definition at line 144 of file ktcpsocket.h.
◆ EncryptionMode
Enumerator |
---|
UnencryptedMode | |
SslClientMode | |
SslServerMode | |
Definition at line 213 of file ktcpsocket.h.
◆ Error
Enumerator |
---|
UnknownError | |
ConnectionRefusedError | |
RemoteHostClosedError | |
HostNotFoundError | |
SocketAccessError | |
SocketResourceError | |
SocketTimeoutError | |
NetworkError | |
UnsupportedSocketOperationError | |
SslHandshakeFailedError | - Since
- 4.10.5
|
Definition at line 169 of file ktcpsocket.h.
◆ ProxyPolicy
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.
◆ SslVersion
Enumerator |
---|
UnknownSslVersion | |
SslV2 | |
SslV3 | |
TlsV1 | |
SslV3_1 | |
TlsV1SslV3 | |
SecureProtocols | |
AnySslVersion | |
Definition at line 158 of file ktcpsocket.h.
◆ State
Enumerator |
---|
UnconnectedState | |
HostLookupState | |
ConnectingState | |
ConnectedState | |
BoundState | |
ListeningState | |
ClosingState | |
Definition at line 148 of file ktcpsocket.h.
◆ KTcpSocket()
KTcpSocket::KTcpSocket |
( |
QObject * |
parent = 0 | ) |
|
◆ ~KTcpSocket()
KTcpSocket::~KTcpSocket |
( |
| ) |
|
◆ abort()
void KTcpSocket::abort |
( |
| ) |
|
◆ addCaCertificate()
void KTcpSocket::addCaCertificate |
( |
const QSslCertificate & |
certificate | ) |
|
◆ addCaCertificates()
void KTcpSocket::addCaCertificates |
( |
const QList< QSslCertificate > & |
certificates | ) |
|
◆ advertisedSslVersion()
◆ atEnd()
bool KTcpSocket::atEnd |
( |
| ) |
const |
|
virtual |
◆ bytesAvailable()
qint64 KTcpSocket::bytesAvailable |
( |
| ) |
const |
|
virtual |
◆ bytesToWrite()
qint64 KTcpSocket::bytesToWrite |
( |
| ) |
const |
|
virtual |
◆ caCertificates()
QList< QSslCertificate > KTcpSocket::caCertificates |
( |
| ) |
const |
◆ canReadLine()
bool KTcpSocket::canReadLine |
( |
| ) |
const |
|
virtual |
◆ ciphers()
◆ close()
void KTcpSocket::close |
( |
| ) |
|
|
virtual |
◆ connected
void KTcpSocket::connected |
( |
| ) |
|
|
signal |
◆ connectToHost() [1/3]
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.
◆ connectToHost() [2/3]
void KTcpSocket::connectToHost |
( |
const QHostAddress & |
hostAddress, |
|
|
quint16 |
port, |
|
|
ProxyPolicy |
policy = AutoProxy |
|
) |
| |
◆ connectToHost() [3/3]
◆ connectToHostEncrypted()
void KTcpSocket::connectToHostEncrypted |
( |
const QString & |
hostName, |
|
|
quint16 |
port, |
|
|
OpenMode |
openMode = ReadWrite |
|
) |
| |
◆ disconnected
void KTcpSocket::disconnected |
( |
| ) |
|
|
signal |
◆ disconnectFromHost()
void KTcpSocket::disconnectFromHost |
( |
| ) |
|
◆ encrypted
void KTcpSocket::encrypted |
( |
| ) |
|
|
signal |
◆ encryptedBytesWritten
void KTcpSocket::encryptedBytesWritten |
( |
qint64 |
written | ) |
|
|
signal |
- Since
- 4.8.1 Forwarded from QSslSocket
◆ encryptionMode()
◆ encryptionModeChanged
◆ error() [1/2]
◆ error [2/2]
◆ flush()
bool KTcpSocket::flush |
( |
| ) |
|
◆ hostFound
void KTcpSocket::hostFound |
( |
| ) |
|
|
signal |
◆ ignoreSslErrors
void KTcpSocket::ignoreSslErrors |
( |
| ) |
|
|
slot |
◆ isSequential()
bool KTcpSocket::isSequential |
( |
| ) |
const |
|
virtual |
◆ isValid()
bool KTcpSocket::isValid |
( |
| ) |
const |
◆ localAddress()
QHostAddress KTcpSocket::localAddress |
( |
| ) |
const |
◆ localCertificate()
QSslCertificate KTcpSocket::localCertificate |
( |
| ) |
const |
◆ negotiatedSslVersion()
◆ negotiatedSslVersionName()
QString KTcpSocket::negotiatedSslVersionName |
( |
| ) |
const |
◆ open()
bool KTcpSocket::open |
( |
QIODevice::OpenMode |
open | ) |
|
|
virtual |
◆ peerAddress()
QHostAddress KTcpSocket::peerAddress |
( |
| ) |
const |
◆ peerCertificateChain()
QList< QSslCertificate > KTcpSocket::peerCertificateChain |
( |
| ) |
const |
◆ peerName()
QString KTcpSocket::peerName |
( |
| ) |
const |
◆ peerPort()
quint16 KTcpSocket::peerPort |
( |
| ) |
const |
◆ privateKey()
KSslKey KTcpSocket::privateKey |
( |
| ) |
const |
◆ proxy()
QNetworkProxy KTcpSocket::proxy |
( |
| ) |
const |
◆ proxyAuthenticationRequired
void KTcpSocket::proxyAuthenticationRequired |
( |
const QNetworkProxy & |
proxy, |
|
|
QAuthenticator * |
authenticator |
|
) |
| |
|
signal |
◆ readBufferSize()
qint64 KTcpSocket::readBufferSize |
( |
| ) |
const |
◆ readData()
◆ sessionCipher()
◆ setAdvertisedSslVersion()
◆ setCaCertificates()
void KTcpSocket::setCaCertificates |
( |
const QList< QSslCertificate > & |
certificates | ) |
|
◆ setCiphers()
◆ setLocalCertificate() [1/2]
void KTcpSocket::setLocalCertificate |
( |
const QSslCertificate & |
certificate | ) |
|
◆ setLocalCertificate() [2/2]
void KTcpSocket::setLocalCertificate |
( |
const QString & |
fileName, |
|
|
QSsl::EncodingFormat |
format = QSsl::Pem |
|
) |
| |
◆ setPrivateKey() [1/2]
void KTcpSocket::setPrivateKey |
( |
const KSslKey & |
key | ) |
|
◆ setPrivateKey() [2/2]
void KTcpSocket::setPrivateKey |
( |
const QString & |
fileName, |
|
|
KSslKey::Algorithm |
algorithm = KSslKey::Rsa , |
|
|
QSsl::EncodingFormat |
format = QSsl::Pem , |
|
|
const QByteArray & |
passPhrase = QByteArray() |
|
) |
| |
◆ setProxy()
void KTcpSocket::setProxy |
( |
const QNetworkProxy & |
proxy | ) |
|
◆ setReadBufferSize()
void KTcpSocket::setReadBufferSize |
( |
qint64 |
size | ) |
|
◆ setSocketOption()
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.
◆ setSslConfiguration()
void KTcpSocket::setSslConfiguration |
( |
const QSslConfiguration & |
configuration | ) |
|
Sets the socket's SSL configuration.
- Since
- 4.8.4
Definition at line 822 of file ktcpsocket.cpp.
◆ setVerificationPeerName()
void KTcpSocket::setVerificationPeerName |
( |
const QString & |
hostName | ) |
|
◆ socketOption()
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.
◆ sslConfiguration()
QSslConfiguration KTcpSocket::sslConfiguration |
( |
| ) |
const |
Returns the socket's SSL configuration.
- Since
- 4.8.4
Definition at line 817 of file ktcpsocket.cpp.
◆ sslErrors() [1/2]
◆ sslErrors [2/2]
◆ startClientEncryption
void KTcpSocket::startClientEncryption |
( |
| ) |
|
|
slot |
◆ state()
◆ stateChanged
◆ waitForBytesWritten()
bool KTcpSocket::waitForBytesWritten |
( |
int |
msecs | ) |
|
|
virtual |
◆ waitForConnected()
bool KTcpSocket::waitForConnected |
( |
int |
msecs = 30000 | ) |
|
◆ waitForDisconnected()
bool KTcpSocket::waitForDisconnected |
( |
int |
msecs = 30000 | ) |
|
◆ waitForEncrypted()
bool KTcpSocket::waitForEncrypted |
( |
int |
msecs = 30000 | ) |
|
◆ waitForReadyRead()
bool KTcpSocket::waitForReadyRead |
( |
int |
msecs = 30000 | ) |
|
|
virtual |
◆ writeData()
qint64 KTcpSocket::writeData |
( |
const char * |
data, |
|
|
qint64 |
maxSize |
|
) |
| |
|
protectedvirtual |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by
doxygen 1.9.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.