KDECore
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 | aboutToClose () |
| void | bytesWritten (qint64 bytes) |
| void | connected () |
| void | disconnected () |
| void | encrypted () |
| void | encryptionModeChanged (EncryptionMode) |
| void | error (KTcpSocket::Error) |
| void | hostFound () |
| void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator) |
| void | readyRead () |
| void | sslErrors (const QList< KSslError > &errors) |
| void | stateChanged (State) |
Public Member Functions | |
| 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 |
| KTcpSocket (QObject *parent=0) | |
| 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) |
| 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) |
| ~KTcpSocket () | |
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 376 of file ktcpsocket.cpp.
| KTcpSocket::~KTcpSocket | ( | ) |
Definition at line 402 of file ktcpsocket.cpp.
Member Function Documentation
| void KTcpSocket::abort | ( | ) |
Definition at line 479 of file ktcpsocket.cpp.
| void KTcpSocket::aboutToClose | ( | ) | [signal] |
| void KTcpSocket::addCaCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 633 of file ktcpsocket.cpp.
| void KTcpSocket::addCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 648 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::advertisedSslVersion | ( | ) | const |
Definition at line 784 of file ktcpsocket.cpp.
| bool KTcpSocket::atEnd | ( | ) | const [virtual] |
Definition at line 409 of file ktcpsocket.cpp.
| qint64 KTcpSocket::bytesAvailable | ( | ) | const [virtual] |
Definition at line 415 of file ktcpsocket.cpp.
| qint64 KTcpSocket::bytesToWrite | ( | ) | const [virtual] |
Definition at line 421 of file ktcpsocket.cpp.
| void KTcpSocket::bytesWritten | ( | qint64 | bytes | ) | [signal] |
| QList< QSslCertificate > KTcpSocket::caCertificates | ( | ) | const |
Definition at line 654 of file ktcpsocket.cpp.
| bool KTcpSocket::canReadLine | ( | ) | const [virtual] |
Definition at line 427 of file ktcpsocket.cpp.
| QList< KSslCipher > KTcpSocket::ciphers | ( | ) | const |
Definition at line 661 of file ktcpsocket.cpp.
| void KTcpSocket::close | ( | ) | [virtual] |
Definition at line 433 of file ktcpsocket.cpp.
| void KTcpSocket::connected | ( | ) | [signal] |
| 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 511 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHost | ( | const QHostAddress & | hostAddress, | |
| quint16 | port, | |||
| ProxyPolicy | policy = AutoProxy | |||
| ) |
Definition at line 501 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHost | ( | const QString & | hostName, | |
| quint16 | port, | |||
| ProxyPolicy | policy = AutoProxy | |||
| ) |
Definition at line 485 of file ktcpsocket.cpp.
| void KTcpSocket::connectToHostEncrypted | ( | const QString & | hostName, | |
| quint16 | port, | |||
| OpenMode | openMode = ReadWrite | |||
| ) |
Definition at line 667 of file ktcpsocket.cpp.
| void KTcpSocket::disconnected | ( | ) | [signal] |
| void KTcpSocket::disconnectFromHost | ( | ) |
Definition at line 521 of file ktcpsocket.cpp.
| void KTcpSocket::encrypted | ( | ) | [signal] |
| KTcpSocket::EncryptionMode KTcpSocket::encryptionMode | ( | ) | const |
Definition at line 748 of file ktcpsocket.cpp.
| void KTcpSocket::encryptionModeChanged | ( | EncryptionMode | ) | [signal] |
| void KTcpSocket::error | ( | KTcpSocket::Error | ) | [signal] |
| KTcpSocket::Error KTcpSocket::error | ( | ) | const |
Definition at line 528 of file ktcpsocket.cpp.
| bool KTcpSocket::flush | ( | ) |
Definition at line 546 of file ktcpsocket.cpp.
| void KTcpSocket::hostFound | ( | ) | [signal] |
| void KTcpSocket::ignoreSslErrors | ( | ) | [slot] |
Definition at line 755 of file ktcpsocket.cpp.
| bool KTcpSocket::isSequential | ( | ) | const [virtual] |
Definition at line 440 of file ktcpsocket.cpp.
| bool KTcpSocket::isValid | ( | ) | const |
Definition at line 552 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::localAddress | ( | ) | const |
Definition at line 558 of file ktcpsocket.cpp.
| QSslCertificate KTcpSocket::localCertificate | ( | ) | const |
Definition at line 676 of file ktcpsocket.cpp.
| KTcpSocket::SslVersion KTcpSocket::negotiatedSslVersion | ( | ) | const |
Definition at line 790 of file ktcpsocket.cpp.
| QString KTcpSocket::negotiatedSslVersionName | ( | ) | const |
Definition at line 799 of file ktcpsocket.cpp.
| bool KTcpSocket::open | ( | QIODevice::OpenMode | open | ) | [virtual] |
Definition at line 446 of file ktcpsocket.cpp.
| QHostAddress KTcpSocket::peerAddress | ( | ) | const |
Definition at line 564 of file ktcpsocket.cpp.
| QList< QSslCertificate > KTcpSocket::peerCertificateChain | ( | ) | const |
Definition at line 682 of file ktcpsocket.cpp.
| QString KTcpSocket::peerName | ( | ) | const |
Definition at line 570 of file ktcpsocket.cpp.
| quint16 KTcpSocket::peerPort | ( | ) | const |
Definition at line 576 of file ktcpsocket.cpp.
| KSslKey KTcpSocket::privateKey | ( | ) | const |
Definition at line 688 of file ktcpsocket.cpp.
| QNetworkProxy KTcpSocket::proxy | ( | ) | const |
- See also:
- : connectToHost()
Definition at line 582 of file ktcpsocket.cpp.
| void KTcpSocket::proxyAuthenticationRequired | ( | const QNetworkProxy & | proxy, | |
| QAuthenticator * | authenticator | |||
| ) | [signal] |
| qint64 KTcpSocket::readBufferSize | ( | ) | const |
Definition at line 588 of file ktcpsocket.cpp.
Definition at line 466 of file ktcpsocket.cpp.
| void KTcpSocket::readyRead | ( | ) | [signal] |
| KSslCipher KTcpSocket::sessionCipher | ( | ) | const |
Definition at line 694 of file ktcpsocket.cpp.
| void KTcpSocket::setAdvertisedSslVersion | ( | KTcpSocket::SslVersion | version | ) |
Definition at line 778 of file ktcpsocket.cpp.
| void KTcpSocket::setCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |
Definition at line 700 of file ktcpsocket.cpp.
| void KTcpSocket::setCiphers | ( | const QList< KSslCipher > & | ciphers | ) |
Definition at line 707 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QString & | fileName, | |
| QSsl::EncodingFormat | format = QSsl::Pem | |||
| ) |
Definition at line 723 of file ktcpsocket.cpp.
| void KTcpSocket::setLocalCertificate | ( | const QSslCertificate & | certificate | ) |
Definition at line 717 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 736 of file ktcpsocket.cpp.
| void KTcpSocket::setPrivateKey | ( | const KSslKey & | key | ) |
Definition at line 730 of file ktcpsocket.cpp.
| void KTcpSocket::setProxy | ( | const QNetworkProxy & | proxy | ) |
- See also:
- : connectToHost()
Definition at line 594 of file ktcpsocket.cpp.
| void KTcpSocket::setReadBufferSize | ( | qint64 | size | ) |
Definition at line 600 of file ktcpsocket.cpp.
| void KTcpSocket::sslErrors | ( | const QList< KSslError > & | errors | ) | [signal] |
| QList< KSslError > KTcpSocket::sslErrors | ( | ) | const |
Definition at line 534 of file ktcpsocket.cpp.
| void KTcpSocket::startClientEncryption | ( | ) | [slot] |
Definition at line 762 of file ktcpsocket.cpp.
| KTcpSocket::State KTcpSocket::state | ( | ) | const |
Definition at line 606 of file ktcpsocket.cpp.
| void KTcpSocket::stateChanged | ( | State | ) | [signal] |
| bool KTcpSocket::waitForBytesWritten | ( | int | msecs | ) | [virtual] |
Definition at line 454 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForConnected | ( | int | msecs = 30000 |
) |
Definition at line 612 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForDisconnected | ( | int | msecs = 30000 |
) |
Definition at line 622 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForEncrypted | ( | int | msecs = 30000 |
) |
Definition at line 742 of file ktcpsocket.cpp.
| bool KTcpSocket::waitForReadyRead | ( | int | msecs = 30000 |
) | [virtual] |
Definition at line 460 of file ktcpsocket.cpp.
Definition at line 472 of file ktcpsocket.cpp.
The documentation for this class was generated from the following files:
KDE 4.3 API Reference