4#ifndef QABSTRACTSOCKET_H
5#define QABSTRACTSOCKET_H
7#include <QtNetwork/qtnetworkglobal.h>
8#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
9#include <QtNetwork/qabstractsocket.h>
12#include <QtNetwork/qhostaddress.h>
14#include <QtCore/qiodevice.h>
15#include <QtCore/qobject.h>
16#ifndef QT_NO_DEBUG_STREAM
17#include <QtCore/qdebug.h>
24#ifndef QT_NO_NETWORKPROXY
40 UnknownSocketType = -1
44#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
45 enum NetworkLayerProtocol {
49 UnknownNetworkLayerProtocol = -1
51 Q_ENUM(NetworkLayerProtocol)
86 UnknownSocketError = -1
111 DefaultForPlatform = 0x0,
113 DontShareAddress = 0x2,
114 ReuseAddressHint = 0x4
119 PauseOnSslErrors = 0x1
127 PauseModes pauseMode()
const;
128 void setPauseMode(PauseModes pauseMode);
131 BindMode
mode = DefaultForPlatform);
132#if QT_VERSION >= QT_VERSION_CHECK(7,0,0) || defined(Q_QDOC)
145 bool isValid()
const;
147 qint64 bytesAvailable()
const override;
148 qint64 bytesToWrite()
const override;
156 qint64 readBufferSize()
const;
161 virtual qintptr socketDescriptor()
const;
162 virtual bool setSocketDescriptor(
qintptr socketDescriptor, SocketState
state = ConnectedState,
163 OpenMode openMode = ReadWrite);
169 SocketState
state()
const;
170 SocketError
error()
const;
173 void close()
override;
174 bool isSequential()
const override;
178 virtual bool waitForConnected(
int msecs = 30000);
180 bool waitForBytesWritten(
int msecs = 30000)
override;
181 virtual bool waitForDisconnected(
int msecs = 30000);
183#ifndef QT_NO_NETWORKPROXY
196#ifndef QT_NO_NETWORKPROXY
230#ifndef QT_NO_DEBUG_STREAM
238 QAbstractSocket__SocketState, Q_NETWORK_EXPORT)
240 QAbstractSocket__SocketError, Q_NETWORK_EXPORT)
The QAbstractSocket class provides the base functionality common to all socket types.
SocketState
This enum describes the different states in which a socket can be.
void stateChanged(QAbstractSocket::SocketState)
This signal is emitted whenever QAbstractSocket's state changes.
bool bind(quint16 port=0, BindMode mode=DefaultForPlatform)
void errorOccurred(QAbstractSocket::SocketError)
void connected()
This signal is emitted after connectToHost() has been called and a connection has been successfully e...
@ ReceiveBufferSizeSocketOption
@ MulticastLoopbackOption
@ SendBufferSizeSocketOption
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)
SocketError
This enum describes the socket errors that can occur.
@ SocketAddressNotAvailableError
@ ProxyConnectionClosedError
@ ProxyConnectionRefusedError
@ SslInvalidUserDataError
@ ProxyConnectionTimeoutError
@ SslHandshakeFailedError
@ UnsupportedSocketOperationError
@ UnfinishedSocketOperationError
@ ProxyAuthenticationRequiredError
SocketType
This enum describes the transport layer protocol.
void disconnected()
This signal is emitted when the socket has been disconnected.
void hostFound()
This signal is emitted after connectToHost() has been called and the host lookup has succeeded.
bool bind(QHostAddress::SpecialAddress addr, quint16 port=0, BindMode mode=DefaultForPlatform)
The QAuthenticator class provides an authentication object.
The QHostAddress class provides an IP address.
SpecialAddress
\value Null The null address object.
@ UnknownNetworkLayerProtocol
The QHostInfo class provides static functions for host name lookups.
\inmodule QtCore \reentrant
The QNetworkProxy class provides a network layer proxy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
AudioChannelLayoutTag tag
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QT_BEGIN_NAMESPACE const char * socketType(QSocketNotifier::Type type)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
sock connectToHost(url.host(), url.port(80))
device waitForReadyRead(deadline)
void writeData(const QByteArray &data)
serverSocket setProxy(QNetworkProxy::NoProxy)
[0]
socket disconnectFromHost()
[0]
socketLayer bind(QHostAddress::Any, 4000)