46 #include <QtCore/qlist.h> 47 #include <QtCore/qregexp.h> 49 # include <QtNetwork/qtcpsocket.h> 50 # include <QtNetwork/qsslerror.h> 88 void connectToHostEncrypted(
const QString &hostName,
quint16 port, OpenMode mode = ReadWrite);
89 void connectToHostEncrypted(
const QString &hostName,
quint16 port,
const QString &sslPeerName, OpenMode mode = ReadWrite);
91 OpenMode openMode = ReadWrite);
98 bool isEncrypted()
const;
106 int peerVerifyDepth()
const;
107 void setPeerVerifyDepth(
int depth);
109 QString peerVerifyName()
const;
110 void setPeerVerifyName(
const QString &hostName);
125 qint64 encryptedBytesAvailable()
const;
126 qint64 encryptedBytesToWrite()
const;
150 void setCiphers(
const QString &ciphers);
164 static void addDefaultCaCertificate(
const QSslCertificate &certificate);
171 bool waitForEncrypted(
int msecs = 30000);
178 static bool supportsSsl();
182 void startClientEncryption();
183 void startServerEncryption();
184 void ignoreSslErrors();
191 void encryptedBytesWritten(
qint64 totalBytes);
217 #endif // QT_NO_OPENSSL 221 #ifndef QT_NO_OPENSSL The QVariant class acts like a union for the most common Qt data types.
The QDir class provides access to directory structures and their contents.
The QSslKey class provides an interface for private and public keys.
#define QT_END_NAMESPACE
This macro expands to.
bool waitForBytesWritten(int msecs=30000)
Reimplemented Function
bool waitForReadyRead(int msecs=30000)
This function blocks until new data is available for reading and the QIODevice::readyRead() signal ha...
bool waitForDisconnected(int msecs=30000)
Waits until the socket has disconnected, up to msecs milliseconds.
qint64 bytesAvailable() const
Returns the number of incoming bytes that are waiting to be read.
bool flush()
This function writes as much as possible from the internal write buffer to the underlying network soc...
qint64 readData(char *data, qint64 maxlen)
Reimplemented Function
The QByteArray class provides an array of bytes.
SocketOption
This enum represents the options that can be set on a socket.
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
bool atEnd() const
Returns true if no more data is currently available for reading; otherwise returns false...
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
void connectToHostImplementation(const QString &hostName, quint16 port, OpenMode mode=ReadWrite)
Contains the implementation of connectToHost().
void abort()
Aborts the current connection and resets the socket.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
The QSslCipher class represents an SSL cryptographic cipher.
void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
Sets the given option to the value described by value.
SocketState
This enum describes the different states in which a socket can be.
#define QT_BEGIN_NAMESPACE
This macro expands to.
SslProtocol
Describes the protocol of the cipher.
SslMode
Describes the connection modes available for QSslSocket.
bool setSocketDescriptor(int socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite)
Initializes QAbstractSocket with the native socket descriptor socketDescriptor.
SocketError
This enum describes the socket errors that can occur.
bool waitForConnected(int msecs=30000)
Waits until the socket is connected, up to msecs milliseconds.
static const char * data(const QByteArray &arr)
The QTcpSocket class provides a TCP socket.
QVariant socketOption(QAbstractSocket::SocketOption option)
Returns the value of the option option.
void setReadBufferSize(qint64 size)
Sets the size of QAbstractSocket's internal read buffer to be size bytes.
void close()
Closes the I/O device for the socket, disconnects the socket's connection with the host...
PatternSyntax
The syntax used to interpret the meaning of the pattern.
EncodingFormat
Describes supported encoding formats for certificates and keys.
void disconnectFromHostImplementation()
Contains the implementation of disconnectFromHost().
qint64 bytesToWrite() const
Returns the number of bytes that are waiting to be written.
KeyAlgorithm
Describes the different key algorithms supported by QSslKey.
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslConfiguration class holds the configuration and state of an SSL connection.
#define Q_DECLARE_PRIVATE(Class)
The QSslError class provides an SSL error.
qint64 writeData(const char *data, qint64 len)
Reimplemented Function
bool canReadLine() const
Returns true if a line of data can be read from the socket; otherwise returns false.
The QAbstractSocket class provides the base functionality common to all socket types.
static QString fileName(const QString &fileUrl)
PeerVerifyMode
Describes the peer verification modes for QSslSocket.