KTcpSocket Class Reference
#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, 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 | 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 QString &fileName, QSsl::EncodingFormat format=QSsl::Pem) |
| void | setLocalCertificate (const QSslCertificate &certificate) |
| void | setPrivateKey (const QString &fileName, KSslKey::Algorithm algorithm=KSslKey::Rsa, QSsl::EncodingFormat format=QSsl::Pem, const QByteArray &passPhrase=QByteArray()) |
| void | setPrivateKey (const KSslKey &key) |
| void | setProxy (const QNetworkProxy &proxy) |
| void | setReadBufferSize (qint64 size) |
| void | setSocketOption (QAbstractSocket::SocketOption options, const QVariant &value) |
| QVariant | socketOption (QAbstractSocket::SocketOption options) 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
Definition at line 210 of file ktcpsocket.h.
| enum KTcpSocket::Error |
- Enumerator:
UnknownError ConnectionRefusedError RemoteHostClosedError HostNotFoundError SocketAccessError SocketResourceError SocketTimeoutError NetworkError UnsupportedSocketOperationError
Definition at line 167 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 215 of file ktcpsocket.h.
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 375 of file ktcpsocket.cpp.
| KTcpSocket::~KTcpSocket | ( | ) |
Definition at line 403 of file ktcpsocket.cpp.
Member Function Documentation
| void KTcpSocket::abort | ( | ) |
Definition at line 480 of file ktcpsocket.cpp.
| void KTcpSocket::addCaCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 636 of file ktcpsocket.cpp.
| void KTcpSocket::addCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 653 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::advertisedSslVersion | ( | ) | const |
Definition at line 805 of file ktcpsocket.cpp.
| bool KTcpSocket::atEnd | ( | ) | const [virtual] |
Definition at line 410 of file ktcpsocket.cpp.
| qint64 KTcpSocket::bytesAvailable | ( | ) | const [virtual] |
Definition at line 416 of file ktcpsocket.cpp.
| qint64 KTcpSocket::bytesToWrite | ( | ) | const [virtual] |
Definition at line 422 of file ktcpsocket.cpp.
| QList< QSslCertificate > KTcpSocket::caCertificates | ( | ) | const |
Definition at line 660 of file ktcpsocket.cpp.
| bool KTcpSocket::canReadLine | ( | ) | const [virtual] |
Definition at line 428 of file ktcpsocket.cpp.
| QList< KSslCipher > KTcpSocket::ciphers | ( | ) | const |
Definition at line 667 of file ktcpsocket.cpp.
| void KTcpSocket::close | ( | ) | [virtual] |
Definition at line 434 of file ktcpsocket.cpp.
| void KTcpSocket::connected | ( | ) | [signal] |
| void KTcpSocket::connectToHost | ( | const QString & | hostName, |
| quint16 | port, | ||
| ProxyPolicy | policy = AutoProxy |
||
| ) |
Definition at line 486 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHost | ( | const QHostAddress & | hostAddress, |
| quint16 | port, | ||
| ProxyPolicy | policy = AutoProxy |
||
| ) |
Definition at line 502 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 512 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHostEncrypted | ( | const QString & | hostName, |
| quint16 | port, | ||
| OpenMode | openMode = ReadWrite |
||
| ) |
Definition at line 673 of file ktcpsocket.cpp.
| void KTcpSocket::disconnected | ( | ) | [signal] |
| void KTcpSocket::disconnectFromHost | ( | ) |
Definition at line 522 of file ktcpsocket.cpp.
| void KTcpSocket::encrypted | ( | ) | [signal] |
| KTcpSocket::EncryptionMode KTcpSocket::encryptionMode | ( | ) | const |
Definition at line 760 of file ktcpsocket.cpp.
| void KTcpSocket::encryptionModeChanged | ( | EncryptionMode | ) | [signal] |
| KTcpSocket::Error KTcpSocket::error | ( | ) | const |
Definition at line 529 of file ktcpsocket.cpp.
| void KTcpSocket::error | ( | KTcpSocket::Error | ) | [signal] |
| bool KTcpSocket::flush | ( | ) |
Definition at line 547 of file ktcpsocket.cpp.
| void KTcpSocket::hostFound | ( | ) | [signal] |
| void KTcpSocket::ignoreSslErrors | ( | ) | [slot] |
Definition at line 776 of file ktcpsocket.cpp.
| bool KTcpSocket::isSequential | ( | ) | const [virtual] |
Definition at line 441 of file ktcpsocket.cpp.
| bool KTcpSocket::isValid | ( | ) | const |
Definition at line 553 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::localAddress | ( | ) | const |
Definition at line 559 of file ktcpsocket.cpp.
| QSslCertificate KTcpSocket::localCertificate | ( | ) | const |
Definition at line 682 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::negotiatedSslVersion | ( | ) | const |
Definition at line 811 of file ktcpsocket.cpp.
| QString KTcpSocket::negotiatedSslVersionName | ( | ) | const |
Definition at line 820 of file ktcpsocket.cpp.
| bool KTcpSocket::open | ( | QIODevice::OpenMode | open | ) | [virtual] |
Definition at line 447 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::peerAddress | ( | ) | const |
Definition at line 565 of file ktcpsocket.cpp.
| QList< QSslCertificate > KTcpSocket::peerCertificateChain | ( | ) | const |
Definition at line 688 of file ktcpsocket.cpp.
| QString KTcpSocket::peerName | ( | ) | const |
Definition at line 571 of file ktcpsocket.cpp.
| quint16 KTcpSocket::peerPort | ( | ) | const |
Definition at line 577 of file ktcpsocket.cpp.
| KSslKey KTcpSocket::privateKey | ( | ) | const |
Definition at line 694 of file ktcpsocket.cpp.
| QNetworkProxy KTcpSocket::proxy | ( | ) | const |
- See also:
- : connectToHost()
Definition at line 584 of file ktcpsocket.cpp.
| void KTcpSocket::proxyAuthenticationRequired | ( | const QNetworkProxy & | proxy, |
| QAuthenticator * | authenticator | ||
| ) | [signal] |
| qint64 KTcpSocket::readBufferSize | ( | ) | const |
Definition at line 590 of file ktcpsocket.cpp.
Definition at line 467 of file ktcpsocket.cpp.
| KSslCipher KTcpSocket::sessionCipher | ( | ) | const |
Definition at line 700 of file ktcpsocket.cpp.
| void KTcpSocket::setAdvertisedSslVersion | ( | KTcpSocket::SslVersion | version | ) |
Definition at line 799 of file ktcpsocket.cpp.
| void KTcpSocket::setCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 706 of file ktcpsocket.cpp.
| void KTcpSocket::setCiphers | ( | const QList< KSslCipher > & | ciphers | ) |
Definition at line 713 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 724 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QString & | fileName, |
| QSsl::EncodingFormat | format = QSsl::Pem |
||
| ) |
Definition at line 730 of file ktcpsocket.cpp.
| void KTcpSocket::setPrivateKey | ( | const KSslKey & | key | ) |
Definition at line 737 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 744 of file ktcpsocket.cpp.
| void KTcpSocket::setProxy | ( | const QNetworkProxy & | proxy | ) |
- See also:
- : connectToHost()
Definition at line 597 of file ktcpsocket.cpp.
| void KTcpSocket::setReadBufferSize | ( | qint64 | size | ) |
Definition at line 603 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 770 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 765 of file ktcpsocket.cpp.
| QList< KSslError > KTcpSocket::sslErrors | ( | ) | const |
Definition at line 535 of file ktcpsocket.cpp.
| void KTcpSocket::sslErrors | ( | const QList< KSslError > & | errors | ) | [signal] |
| void KTcpSocket::startClientEncryption | ( | ) | [slot] |
Definition at line 783 of file ktcpsocket.cpp.
| KTcpSocket::State KTcpSocket::state | ( | ) | const |
Definition at line 609 of file ktcpsocket.cpp.
| void KTcpSocket::stateChanged | ( | KTcpSocket::State | ) | [signal] |
| bool KTcpSocket::waitForBytesWritten | ( | int | msecs | ) | [virtual] |
Definition at line 455 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForConnected | ( | int | msecs = 30000 | ) |
Definition at line 615 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForDisconnected | ( | int | msecs = 30000 | ) |
Definition at line 625 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForEncrypted | ( | int | msecs = 30000 | ) |
Definition at line 754 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForReadyRead | ( | int | msecs = 30000 | ) | [virtual] |
Definition at line 461 of file ktcpsocket.cpp.
Definition at line 473 of file ktcpsocket.cpp.
The documentation for this class was generated from the following files:
KDE 4.6 API Reference