KDECore
#include <ktcpsocket.h>
Public Types | |
| enum | EncryptionMode { UnencryptedMode = 0, SslClientMode, SslServerMode } |
| enum | Error { UnknownError = 0, ConnectionRefusedError, RemoteHostClosedError, HostNotFoundError, SocketAccessError, SocketResourceError, SocketTimeoutError, NetworkError, UnsupportedSocketOperationError } |
| 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) |
Protected Member Functions | |
| virtual qint64 | readData (char *data, qint64 maxSize) |
| virtual qint64 | writeData (const char *data, qint64 maxSize) |
Detailed Description
Definition at line 144 of file ktcpsocket.h.
Member Enumeration Documentation
| Enumerator | |
|---|---|
| UnencryptedMode | |
| SslClientMode | |
| SslServerMode | |
Definition at line 212 of file ktcpsocket.h.
| enum KTcpSocket::Error |
| Enumerator | |
|---|---|
| UnknownError | |
| ConnectionRefusedError | |
| RemoteHostClosedError | |
| HostNotFoundError | |
| SocketAccessError | |
| SocketResourceError | |
| SocketTimeoutError | |
| NetworkError | |
| UnsupportedSocketOperationError | |
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 217 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 393 of file ktcpsocket.cpp.
| KTcpSocket::~KTcpSocket | ( | ) |
Definition at line 422 of file ktcpsocket.cpp.
Member Function Documentation
| void KTcpSocket::abort | ( | ) |
Definition at line 499 of file ktcpsocket.cpp.
| void KTcpSocket::addCaCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 655 of file ktcpsocket.cpp.
| void KTcpSocket::addCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 672 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::advertisedSslVersion | ( | ) | const |
Definition at line 855 of file ktcpsocket.cpp.
|
virtual |
Definition at line 429 of file ktcpsocket.cpp.
|
virtual |
Definition at line 435 of file ktcpsocket.cpp.
|
virtual |
Definition at line 441 of file ktcpsocket.cpp.
| QList< QSslCertificate > KTcpSocket::caCertificates | ( | ) | const |
Definition at line 679 of file ktcpsocket.cpp.
|
virtual |
Definition at line 447 of file ktcpsocket.cpp.
| QList< KSslCipher > KTcpSocket::ciphers | ( | ) | const |
Definition at line 686 of file ktcpsocket.cpp.
|
virtual |
Definition at line 453 of file ktcpsocket.cpp.
|
signal |
| void KTcpSocket::connectToHost | ( | const QString & | hostName, |
| quint16 | port, | ||
| ProxyPolicy | policy = AutoProxy |
||
| ) |
Definition at line 505 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHost | ( | const QHostAddress & | hostAddress, |
| quint16 | port, | ||
| ProxyPolicy | policy = AutoProxy |
||
| ) |
Definition at line 521 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 531 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHostEncrypted | ( | const QString & | hostName, |
| quint16 | port, | ||
| OpenMode | openMode = ReadWrite |
||
| ) |
Definition at line 692 of file ktcpsocket.cpp.
|
signal |
| void KTcpSocket::disconnectFromHost | ( | ) |
Definition at line 541 of file ktcpsocket.cpp.
|
signal |
|
signal |
- Since
- 4.8.1 Forwarded from QSslSocket
| KTcpSocket::EncryptionMode KTcpSocket::encryptionMode | ( | ) | const |
Definition at line 800 of file ktcpsocket.cpp.
|
signal |
| KTcpSocket::Error KTcpSocket::error | ( | ) | const |
Definition at line 548 of file ktcpsocket.cpp.
|
signal |
| bool KTcpSocket::flush | ( | ) |
Definition at line 566 of file ktcpsocket.cpp.
|
signal |
|
slot |
Definition at line 826 of file ktcpsocket.cpp.
|
virtual |
Definition at line 460 of file ktcpsocket.cpp.
| bool KTcpSocket::isValid | ( | ) | const |
Definition at line 572 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::localAddress | ( | ) | const |
Definition at line 578 of file ktcpsocket.cpp.
| QSslCertificate KTcpSocket::localCertificate | ( | ) | const |
Definition at line 701 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::negotiatedSslVersion | ( | ) | const |
Definition at line 861 of file ktcpsocket.cpp.
| QString KTcpSocket::negotiatedSslVersionName | ( | ) | const |
Definition at line 870 of file ktcpsocket.cpp.
|
virtual |
Definition at line 466 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::peerAddress | ( | ) | const |
Definition at line 584 of file ktcpsocket.cpp.
| QList< QSslCertificate > KTcpSocket::peerCertificateChain | ( | ) | const |
Definition at line 707 of file ktcpsocket.cpp.
| QString KTcpSocket::peerName | ( | ) | const |
Definition at line 590 of file ktcpsocket.cpp.
| quint16 KTcpSocket::peerPort | ( | ) | const |
Definition at line 596 of file ktcpsocket.cpp.
| KSslKey KTcpSocket::privateKey | ( | ) | const |
Definition at line 713 of file ktcpsocket.cpp.
| QNetworkProxy KTcpSocket::proxy | ( | ) | const |
- See Also
- : connectToHost()
Definition at line 603 of file ktcpsocket.cpp.
|
signal |
| qint64 KTcpSocket::readBufferSize | ( | ) | const |
Definition at line 609 of file ktcpsocket.cpp.
Definition at line 486 of file ktcpsocket.cpp.
| KSslCipher KTcpSocket::sessionCipher | ( | ) | const |
Definition at line 719 of file ktcpsocket.cpp.
| void KTcpSocket::setAdvertisedSslVersion | ( | KTcpSocket::SslVersion | version | ) |
Definition at line 849 of file ktcpsocket.cpp.
| void KTcpSocket::setCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 725 of file ktcpsocket.cpp.
| void KTcpSocket::setCiphers | ( | const QList< KSslCipher > & | ciphers | ) |
Definition at line 732 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 743 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QString & | fileName, |
| QSsl::EncodingFormat | format = QSsl::Pem |
||
| ) |
Definition at line 749 of file ktcpsocket.cpp.
| void KTcpSocket::setPrivateKey | ( | const KSslKey & | key | ) |
Definition at line 765 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 780 of file ktcpsocket.cpp.
| void KTcpSocket::setProxy | ( | const QNetworkProxy & | proxy | ) |
- See Also
- : connectToHost()
Definition at line 616 of file ktcpsocket.cpp.
| void KTcpSocket::setReadBufferSize | ( | qint64 | size | ) |
Definition at line 622 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 810 of file ktcpsocket.cpp.
| void KTcpSocket::setSslConfiguration | ( | const QSslConfiguration & | configuration | ) |
| void KTcpSocket::setVerificationPeerName | ( | const QString & | hostName | ) |
Definition at line 755 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 805 of file ktcpsocket.cpp.
| QSslConfiguration KTcpSocket::sslConfiguration | ( | ) | const |
Definition at line 554 of file ktcpsocket.cpp.
|
slot |
Definition at line 833 of file ktcpsocket.cpp.
| KTcpSocket::State KTcpSocket::state | ( | ) | const |
Definition at line 628 of file ktcpsocket.cpp.
|
signal |
|
virtual |
Definition at line 474 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForConnected | ( | int | msecs = 30000 | ) |
Definition at line 634 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForDisconnected | ( | int | msecs = 30000 | ) |
Definition at line 644 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForEncrypted | ( | int | msecs = 30000 | ) |
Definition at line 794 of file ktcpsocket.cpp.
|
virtual |
Definition at line 480 of file ktcpsocket.cpp.
Definition at line 492 of file ktcpsocket.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 20:18:04 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.