465 #include <QtNetwork/private/qtnetworkglobal_p.h>
470 #include "private/qhostinfo_p.h"
482 #include <private/qthread_p.h>
484 #ifdef QABSTRACTSOCKET_DEBUG
486 #include <private/qdebug_p.h>
491 #define Q_CHECK_SOCKETENGINE(returnValue) do { \
492 if (!d->socketEngine) { \
493 return returnValue; \
496 #ifndef QABSTRACTSOCKET_BUFFERSIZE
497 #define QABSTRACTSOCKET_BUFFERSIZE 32768
499 #define QT_TRANSFER_TIMEOUT 120000
503 static const int DefaultConnectTimeout = 30000;
525 : emittedReadyRead(
false),
526 emittedBytesWritten(
false),
534 cachedSocketDescriptor(-1),
535 readBufferMaxSize(0),
537 hasPendingData(
false),
543 preferredNetworkLayerProtocol(
QAbstractSocket::UnknownNetworkLayerProtocol)
563 #if defined (QABSTRACTSOCKET_DEBUG)
564 qDebug(
"QAbstractSocketPrivate::resetSocketLayer()");
587 #ifdef QT_NO_NETWORKPROXY
593 #if defined (QABSTRACTSOCKET_DEBUG)
602 else protocolStr =
QLatin1String(
"UnknownNetworkLayerProtocol");
613 #if defined (QABSTRACTSOCKET_DEBUG)
614 qDebug(
"QAbstractSocketPrivate::initSocketLayer(%s, %s) failed (%s)",
627 #if defined (QABSTRACTSOCKET_DEBUG)
628 qDebug(
"QAbstractSocketPrivate::initSocketLayer(%s, %s) success",
655 #if defined (QABSTRACTSOCKET_DEBUG)
656 qDebug(
"QAbstractSocketPrivate::canReadNotification()");
666 #if defined (QABSTRACTSOCKET_DEBUG)
667 qDebug(
"QAbstractSocketPrivate::canReadNotification() buffer is full");
675 #if defined (QABSTRACTSOCKET_DEBUG)
676 qDebug(
"QAbstractSocketPrivate::canReadNotification() disconnecting socket");
678 q->disconnectFromHost();
683 if (
buffer.size() == oldBufferSize) {
686 return !
q->isReadable();
698 #if defined (QABSTRACTSOCKET_DEBUG)
701 qDebug(
"QAbstractSocketPrivate::canReadNotification() socket is closing - returning");
717 #if defined (QABSTRACTSOCKET_DEBUG)
718 qDebug(
"QAbstractSocketPrivate::canCloseNotification()");
729 if (!hadReadFromSocket) {
730 q->disconnectFromHost();
733 newBytes =
buffer.size() - newBytes;
758 #if defined (QABSTRACTSOCKET_DEBUG)
759 qDebug(
"QAbstractSocketPrivate::canWriteNotification() flushing");
775 #if defined (QABSTRACTSOCKET_DEBUG)
776 qDebug(
"QAbstractSocketPrivate::connectionNotification() testing connection");
796 #if defined (QABSTRACTSOCKET_DEBUG)
797 qDebug(
"QAbstractSocketPrivate::writeToSocket() nothing to do: valid ? %s, writeBuffer.isEmpty() ? %s",
803 q->disconnectFromHost();
818 #if defined (QABSTRACTSOCKET_DEBUG)
819 qDebug() <<
"QAbstractSocketPrivate::writeToSocket() write error, aborting."
828 #if defined (QABSTRACTSOCKET_DEBUG)
829 qDebug(
"QAbstractSocketPrivate::writeToSocket() %lld bytes written to the network",
844 q->disconnectFromHost();
857 bool dataWasWritten =
false;
860 dataWasWritten =
true;
862 return dataWasWritten;
865 #ifndef QT_NO_NETWORKPROXY
912 #if !defined(QT_NO_NETWORKPROXY)
925 #if defined(QABSTRACTSOCKET_DEBUG)
926 qDebug(
"QAbstractSocketPrivate::startConnectingByName(host == %s)", qPrintable(
host));
971 qWarning(
"QAbstractSocketPrivate::_q_startConnecting() received hostInfo for wrong lookup ID %d expected %d", hostInfo.
lookupId(),
hostLookupId);
979 const auto candidates = hostInfo.
addresses();
987 #if defined(QABSTRACTSOCKET_DEBUG)
994 qDebug(
"QAbstractSocketPrivate::_q_startConnecting(hostInfo == %s)",
s.toLatin1().constData());
1003 #if defined(QABSTRACTSOCKET_DEBUG)
1004 qDebug(
"QAbstractSocketPrivate::_q_startConnecting(), host not found");
1019 emit q->hostFound();
1041 #if defined(QABSTRACTSOCKET_DEBUG)
1042 qDebug(
"QAbstractSocketPrivate::_q_connectToNextAddress(), all addresses failed.");
1069 #if defined(QABSTRACTSOCKET_DEBUG)
1070 qDebug(
"QAbstractSocketPrivate::_q_connectToNextAddress(), connecting to %s:%i, %d left to try",
1076 #if defined(QABSTRACTSOCKET_DEBUG)
1077 qDebug(
"QAbstractSocketPrivate::_q_connectToNextAddress(), failed to initialize sock layer");
1095 #if defined(QABSTRACTSOCKET_DEBUG)
1096 qDebug(
"QAbstractSocketPrivate::_q_connectToNextAddress(), connection failed (%s)",
1110 int connectTimeout = DefaultConnectTimeout;
1137 q_func()->disconnectFromHost();
1148 #if defined(QABSTRACTSOCKET_DEBUG)
1149 qDebug(
"QAbstractSocketPrivate::_q_testConnection() connection failed,"
1150 " checking for alternative addresses");
1165 #if defined(QABSTRACTSOCKET_DEBUG)
1166 qDebug(
"QAbstractSocketPrivate::_q_abortConnectionAttempt() (timed out)");
1194 if (bytesToRead == 0) {
1205 if (
q->isReadable()) {
1209 #if defined(QABSTRACTSOCKET_DEBUG)
1210 qDebug(
"QAbstractSocketPrivate::readFromSocket() about to read %lld bytes",
1215 char *ptr =
buffer.reserve(bytesToRead);
1217 if (readBytes == -2) {
1219 buffer.chop(bytesToRead);
1222 buffer.chop(bytesToRead - (readBytes < 0 ?
qint64(0) : readBytes));
1223 #if defined(QABSTRACTSOCKET_DEBUG)
1224 qDebug(
"QAbstractSocketPrivate::readFromSocket() got %lld bytes, buffer size = %lld",
1225 readBytes,
buffer.size());
1231 #if defined(QABSTRACTSOCKET_DEBUG)
1232 qDebug(
"QAbstractSocketPrivate::readFromSocket() about to discard %lld bytes",
1239 #if defined(QABSTRACTSOCKET_DEBUG)
1240 qDebug(
"QAbstractSocketPrivate::readFromSocket() read failed: %s",
1262 emit q->readyRead();
1265 emit q->channelReadyRead(channel);
1279 emit q->bytesWritten(bytes);
1282 emit q->channelBytesWritten(channel, bytes);
1295 if (
q->isReadable()) {
1298 if (inboundStreamCount == 0)
1301 if (
q->isWritable()) {
1304 if (outboundStreamCount == 0)
1317 #if defined(QABSTRACTSOCKET_DEBUG)
1318 qDebug(
"QAbstractSocketPrivate::fetchConnectionParameters() connection to %s:%i established",
1322 emit q->connected();
1332 if (!
d->socketEngine || !
d->socketEngine->isValid()
1353 #ifdef QABSTRACTSOCKET_DEBUG
1355 <<
"pause notifiers, storing 'true' states, currently read:" <<
read
1356 <<
"write:" <<
write <<
"except:" << except;
1361 socket->d_func()->prePauseReadSocketNotifierState =
true;
1365 socket->d_func()->prePauseWriteSocketNotifierState =
true;
1369 socket->d_func()->prePauseExceptionSocketNotifierState =
true;
1380 #ifdef QABSTRACTSOCKET_DEBUG
1396 return socket->d_func()->socketEngine;
1422 emit q->errorOccurred(errorCode);
1435 #if defined(QABSTRACTSOCKET_DEBUG)
1436 qDebug(
"QAbstractSocket::QAbstractSocket(%sSocket, QAbstractSocketPrivate == %p, parent == %p)",
1460 #if defined(QABSTRACTSOCKET_DEBUG)
1461 qDebug(
"QAbstractSocket::~QAbstractSocket()");
1493 return d_func()->pauseMode;
1620 #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
1638 return d_func()->socketEngine ? d_func()->socketEngine->isValid() :
isOpen();
1669 #if defined(QABSTRACTSOCKET_DEBUG)
1670 qDebug(
"QAbstractSocket::connectToHost(\"%s\", %i, %i)...", qPrintable(hostName),
port,
1676 qWarning(
"QAbstractSocket::connectToHost() called when already looking up or connecting/connected to \"%s\"", qPrintable(hostName));
1677 d->setErrorAndEmit(
OperationError,
tr(
"Trying to connect while connection is in progress"));
1681 d->preferredNetworkLayerProtocol = protocol;
1682 d->hostName = hostName;
1684 d->setReadChannelCount(0);
1685 d->setWriteChannelCount(0);
1686 d->abortCalled =
false;
1687 d->pendingClose =
false;
1691 d->localAddress.clear();
1694 d->peerAddress.clear();
1695 d->peerName = hostName;
1696 if (
d->hostLookupId != -1) {
1698 d->hostLookupId = -1;
1701 #ifndef QT_NO_NETWORKPROXY
1703 d->resolveProxy(hostName,
port);
1707 tr(
"Operation on socket is not supported"));
1715 d->isBuffered =
false;
1716 else if (!d_func()->isBuffered)
1720 d->readChannelCount =
d->writeChannelCount = 0;
1729 d->_q_startConnecting(
info);
1730 #ifndef QT_NO_NETWORKPROXY
1733 d->startConnectingByName(hostName);
1737 if (
d->threadData.loadRelaxed()->hasEventDispatcher()) {
1740 bool immediateResultValid =
false;
1744 &immediateResultValid,
1746 if (immediateResultValid) {
1747 d->hostLookupId = -1;
1748 d->_q_startConnecting(hostInfo);
1753 #if defined(QABSTRACTSOCKET_DEBUG)
1757 ?
" (connection in progress)" :
"");
1768 #if defined(QABSTRACTSOCKET_DEBUG)
1769 qDebug(
"QAbstractSocket::connectToHost([%s], %i, %i)...",
1785 #if defined(QABSTRACTSOCKET_DEBUG)
1786 qDebug(
"QAbstractSocket::bytesToWrite() == %lld", pendingBytes);
1788 return pendingBytes;
1801 if (!
d->isBuffered &&
d->socketEngine &&
d->socketEngine->isValid())
1802 available +=
d->socketEngine->bytesAvailable();
1804 #if defined(QABSTRACTSOCKET_DEBUG)
1805 qDebug(
"QAbstractSocket::bytesAvailable() == %lld", available);
1819 return d->localPort;
1835 return d->localAddress;
1859 return d->peerAddress;
1871 return d->peerName.isEmpty() ?
d->hostName :
d->peerName;
1889 return d->cachedSocketDescriptor;
1910 d->resetSocketLayer();
1911 d->setReadChannelCount(0);
1912 d->setWriteChannelCount(0);
1914 if (!
d->socketEngine) {
1920 d->setError(
d->socketEngine->error(),
d->socketEngine->errorString());
1926 if (
d->threadData.loadRelaxed()->hasEventDispatcher())
1927 d->socketEngine->setReceiver(
d);
1933 const int inboundStreamCount =
d->socketEngine->inboundStreamCount();
1934 d->setReadChannelCount(qMax(1, inboundStreamCount));
1935 if (inboundStreamCount == 0)
1936 d->readChannelCount = 0;
1939 const int outboundStreamCount =
d->socketEngine->outboundStreamCount();
1940 d->setWriteChannelCount(qMax(1, outboundStreamCount));
1941 if (outboundStreamCount == 0)
1942 d->writeChannelCount = 0;
1945 d->readChannelCount =
d->writeChannelCount = 0;
1948 if (
d->state != socketState) {
1949 d->state = socketState;
1953 d->pendingClose =
false;
1954 d->socketEngine->setReadNotificationEnabled(
true);
1955 d->localPort =
d->socketEngine->localPort();
1956 d->peerPort =
d->socketEngine->peerPort();
1957 d->localAddress =
d->socketEngine->localAddress();
1958 d->peerAddress =
d->socketEngine->peerAddress();
1976 if (!d_func()->socketEngine)
2022 if (!d_func()->socketEngine)
2092 #if defined (QABSTRACTSOCKET_DEBUG)
2093 qDebug(
"QAbstractSocket::waitForConnected(%i)", msecs);
2097 #if defined (QABSTRACTSOCKET_DEBUG)
2098 qDebug(
"QAbstractSocket::waitForConnected(%i) already connected", msecs);
2103 bool wasPendingClose =
d->pendingClose;
2104 d->pendingClose =
false;
2109 #if defined (QABSTRACTSOCKET_DEBUG)
2110 qDebug(
"QAbstractSocket::waitForConnected(%i) doing host name lookup", msecs);
2113 d->hostLookupId = -1;
2118 d->_q_startConnecting(
info);
2126 int connectTimeout = DefaultConnectTimeout;
2127 bool timedOut =
true;
2128 #if defined (QABSTRACTSOCKET_DEBUG)
2133 if (msecs != -1 &&
timeout > connectTimeout)
2135 #if defined (QABSTRACTSOCKET_DEBUG)
2136 qDebug(
"QAbstractSocket::waitForConnected(%i) waiting %.2f secs for connection attempt #%i",
2137 msecs,
timeout / 1000.0, attempt++);
2141 if (
d->socketEngine &&
d->socketEngine->waitForWrite(
timeout, &timedOut) && !timedOut) {
2142 d->_q_testConnection();
2144 d->_q_connectToNextAddress();
2152 d->resetSocketLayer();
2155 #if defined (QABSTRACTSOCKET_DEBUG)
2156 qDebug(
"QAbstractSocket::waitForConnected(%i) == %s", msecs,
2161 if (wasPendingClose)
2184 #if defined (QABSTRACTSOCKET_DEBUG)
2185 qDebug(
"QAbstractSocket::waitForReadyRead(%i)", msecs);
2210 bool readyToRead =
false;
2211 bool readyToWrite =
false;
2212 if (!
d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite,
true, !
d->writeBuffer.isEmpty(),
2214 #if defined (QABSTRACTSOCKET_DEBUG)
2215 qDebug(
"QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",
2216 msecs,
d->socketEngine->error(),
d->socketEngine->errorString().toLatin1().constData());
2218 d->setErrorAndEmit(
d->socketEngine->error(),
d->socketEngine->errorString());
2225 if (
d->canReadNotification())
2230 d->canWriteNotification();
2254 #if defined (QABSTRACTSOCKET_DEBUG)
2255 qDebug(
"QAbstractSocket::waitForBytesWritten(%i)", msecs);
2260 qWarning(
"QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState");
2264 if (
d->writeBuffer.isEmpty())
2277 bool readyToRead =
false;
2278 bool readyToWrite =
false;
2279 if (!
d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite,
2280 !
d->readBufferMaxSize ||
d->buffer.size() <
d->readBufferMaxSize,
2281 !
d->writeBuffer.isEmpty(),
2283 #if defined (QABSTRACTSOCKET_DEBUG)
2284 qDebug(
"QAbstractSocket::waitForBytesWritten(%i) failed (%i, %s)",
2285 msecs,
d->socketEngine->error(),
d->socketEngine->errorString().toLatin1().constData());
2287 d->setErrorAndEmit(
d->socketEngine->error(),
d->socketEngine->errorString());
2294 #if defined (QABSTRACTSOCKET_DEBUG)
2295 qDebug(
"QAbstractSocket::waitForBytesWritten calls canReadNotification");
2297 d->canReadNotification();
2302 if (
d->canWriteNotification()) {
2303 #if defined (QABSTRACTSOCKET_DEBUG)
2304 qDebug(
"QAbstractSocket::waitForBytesWritten returns true");
2342 qWarning(
"QAbstractSocket::waitForDisconnected() is not allowed in UnconnectedState");
2358 bool readyToRead =
false;
2359 bool readyToWrite =
false;
2360 if (!
d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite,
state() ==
ConnectedState,
2361 !
d->writeBuffer.isEmpty(),
2363 #if defined (QABSTRACTSOCKET_DEBUG)
2364 qDebug(
"QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",
2365 msecs,
d->socketEngine->error(),
d->socketEngine->errorString().toLatin1().constData());
2367 d->setErrorAndEmit(
d->socketEngine->error(),
d->socketEngine->errorString());
2374 d->canReadNotification();
2376 d->canWriteNotification();
2394 #if defined (QABSTRACTSOCKET_DEBUG)
2395 qDebug(
"QAbstractSocket::abort()");
2397 d->setWriteChannelCount(0);
2398 d->abortCalled =
true;
2425 return d_func()->flush();
2438 qint64 readBytes = (maxSize && !
d->isBuffered) ?
d->socketEngine->read(
data, maxSize)
2440 if (readBytes == -2) {
2444 if (readBytes < 0) {
2445 d->setError(
d->socketEngine->error(),
d->socketEngine->errorString());
2446 d->resetSocketLayer();
2450 d->hasPendingData =
false;
2451 d->socketEngine->setReadNotificationEnabled(
true);
2454 #if defined (QABSTRACTSOCKET_DEBUG)
2455 qDebug(
"QAbstractSocket::readData(%p \"%s\", %lli) == %lld [engine]",
data,
2474 || (!
d->socketEngine &&
d->socketType !=
TcpSocket && !
d->isBuffered)) {
2480 &&
d->socketEngine &&
d->writeBuffer.isEmpty()) {
2484 d->setError(
d->socketEngine->error(),
d->socketEngine->errorString());
2485 }
else if (written <
size) {
2487 d->writeBuffer.append(
data + written,
size - written);
2489 d->socketEngine->setWriteNotificationEnabled(
true);
2492 #if defined (QABSTRACTSOCKET_DEBUG)
2493 qDebug(
"QAbstractSocket::writeData(%p \"%s\", %lli) == %lli",
data,
2497 }
else if (!
d->isBuffered &&
d->socketType !=
TcpSocket) {
2501 d->setError(
d->socketEngine->error(),
d->socketEngine->errorString());
2503 #if defined (QABSTRACTSOCKET_DEBUG)
2504 qDebug(
"QAbstractSocket::writeData(%p \"%s\", %lli) == %lli",
data,
2508 d->emitBytesWritten(written);
2521 if (
d->socketEngine && !
d->writeBuffer.isEmpty())
2522 d->socketEngine->setWriteNotificationEnabled(
true);
2524 #if defined (QABSTRACTSOCKET_DEBUG)
2525 qDebug(
"QAbstractSocket::writeData(%p \"%s\", %lli) == %lli",
data,
2549 d->localPort =
port;
2642 #if defined(QABSTRACTSOCKET_DEBUG)
2643 qDebug(
"QAbstractSocket::close()");
2661 #if defined(QABSTRACTSOCKET_DEBUG)
2662 qDebug(
"QAbstractSocket::disconnectFromHost()");
2666 #if defined(QABSTRACTSOCKET_DEBUG)
2667 qDebug(
"QAbstractSocket::disconnectFromHost() was called on an unconnected socket");
2673 #if defined(QABSTRACTSOCKET_DEBUG)
2674 qDebug(
"QAbstractSocket::disconnectFromHost() but we're still connecting");
2676 d->pendingClose =
true;
2681 if (
d->socketEngine)
2682 d->socketEngine->setReadNotificationEnabled(
false);
2684 if (
d->abortCalled) {
2685 #if defined(QABSTRACTSOCKET_DEBUG)
2686 qDebug(
"QAbstractSocket::disconnectFromHost() aborting immediately");
2690 d->hostLookupId = -1;
2696 #if defined(QABSTRACTSOCKET_DEBUG)
2697 qDebug(
"QAbstractSocket::disconnectFromHost() emits stateChanged()(ClosingState)");
2701 #if defined(QABSTRACTSOCKET_DEBUG)
2702 qDebug(
"QAbstractSocket::disconnectFromHost() return from delayed close");
2707 if (
d->socketEngine &&
d->socketEngine->isValid() && (!
d->allWriteBuffersEmpty()
2708 ||
d->socketEngine->bytesToWrite() > 0)) {
2709 d->socketEngine->setWriteNotificationEnabled(
true);
2711 #if defined(QABSTRACTSOCKET_DEBUG)
2712 qDebug(
"QAbstractSocket::disconnectFromHost() delaying disconnect");
2716 #if defined(QABSTRACTSOCKET_DEBUG)
2717 qDebug(
"QAbstractSocket::disconnectFromHost() disconnecting immediately");
2723 d->resetSocketLayer();
2734 d->localAddress.clear();
2735 d->peerAddress.clear();
2736 d->peerName.clear();
2737 d->setWriteChannelCount(0);
2739 #if defined(QABSTRACTSOCKET_DEBUG)
2740 qDebug(
"QAbstractSocket::disconnectFromHost() disconnected!");
2757 return d_func()->readBufferMaxSize;
2786 if (
d->readBufferMaxSize ==
size)
2788 d->readBufferMaxSize =
size;
2794 d->socketEngine->setReadNotificationEnabled(
size == 0 ||
d->buffer.size() <
size);
2805 return d_func()->state;
2815 d_func()->state =
state;
2825 return d_func()->socketType;
2835 return d_func()->socketError;
2845 d_func()->socketError = socketError;
2848 #ifndef QT_NO_NETWORKPROXY
2871 d->proxy = networkProxy;
2903 return d->protocolTag;
2917 d->protocolTag =
tag;
2922 #ifndef QT_NO_DEBUG_STREAM
2926 debug.resetFormat().nospace();
2929 debug <<
"QAbstractSocket::ConnectionRefusedError";
2932 debug <<
"QAbstractSocket::RemoteHostClosedError";
2935 debug <<
"QAbstractSocket::HostNotFoundError";
2938 debug <<
"QAbstractSocket::SocketAccessError";
2941 debug <<
"QAbstractSocket::SocketResourceError";
2944 debug <<
"QAbstractSocket::SocketTimeoutError";
2947 debug <<
"QAbstractSocket::DatagramTooLargeError";
2950 debug <<
"QAbstractSocket::NetworkError";
2953 debug <<
"QAbstractSocket::AddressInUseError";
2956 debug <<
"QAbstractSocket::SocketAddressNotAvailableError";
2959 debug <<
"QAbstractSocket::UnsupportedSocketOperationError";
2962 debug <<
"QAbstractSocket::UnfinishedSocketOperationError";
2965 debug <<
"QAbstractSocket::ProxyAuthenticationRequiredError";
2968 debug <<
"QAbstractSocket::UnknownSocketError";
2971 debug <<
"QAbstractSocket::ProxyConnectionRefusedError";
2974 debug <<
"QAbstractSocket::ProxyConnectionClosedError";
2977 debug <<
"QAbstractSocket::ProxyConnectionTimeoutError";
2980 debug <<
"QAbstractSocket::ProxyNotFoundError";
2983 debug <<
"QAbstractSocket::ProxyProtocolError";
2986 debug <<
"QAbstractSocket::SocketError(" << int(
error) <<
')';
2995 debug.resetFormat().nospace();
2998 debug <<
"QAbstractSocket::UnconnectedState";
3001 debug <<
"QAbstractSocket::HostLookupState";
3004 debug <<
"QAbstractSocket::ConnectingState";
3007 debug <<
"QAbstractSocket::ConnectedState";
3010 debug <<
"QAbstractSocket::BoundState";
3013 debug <<
"QAbstractSocket::ListeningState";
3016 debug <<
"QAbstractSocket::ClosingState";
3019 debug <<
"QAbstractSocket::SocketState(" << int(
state) <<
')';
3028 #include "moc_qabstractsocket.cpp"
small capitals from c petite p scientific i
[1]
QAbstractSocket::SocketError error() const
virtual void setWriteNotificationEnabled(bool enable)=0
virtual bool bind(const QHostAddress &address, quint16 port)=0
virtual bool isValid() const =0
virtual bool isReadNotificationEnabled() const =0
void setReceiver(QAbstractSocketEngineReceiver *receiver)
virtual bool connectToHost(const QHostAddress &address, quint16 port)=0
int outboundStreamCount() const
virtual bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol=QAbstractSocket::IPv4Protocol)=0
QAbstractSocket::SocketType socketType() const
virtual qint64 read(char *data, qint64 maxlen)=0
virtual void setReadNotificationEnabled(bool enable)=0
static QAbstractSocketEngine * createSocketEngine(QAbstractSocket::SocketType socketType, const QNetworkProxy &, QObject *parent)
virtual bool setOption(SocketOption option, int value)=0
virtual qint64 write(const char *data, qint64 len)=0
@ MulticastLoopbackOption
@ ReceiveBufferSocketOption
QAbstractSocket::SocketState state() const
virtual qintptr socketDescriptor() const =0
virtual bool connectToHostByName(const QString &name, quint16 port)=0
int inboundStreamCount() const
virtual qint64 bytesAvailable() const =0
QString errorString() const
virtual qint64 bytesToWrite() const =0
quint16 localPort() const
virtual void setExceptionNotificationEnabled(bool enable)=0
virtual bool isWriteNotificationEnabled() const =0
QHostAddress peerAddress() const
virtual bool isExceptionNotificationEnabled() const =0
QHostAddress localAddress() const
The QAbstractSocket class provides the base functionality common to all socket types.
bool isSequential() const override
QAbstractSocket(SocketType socketType, QObject *parent)
void stateChanged(QAbstractSocket::SocketState)
virtual void setReadBufferSize(qint64 size)
static constexpr auto IPv4Protocol
virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
virtual QVariant socketOption(QAbstractSocket::SocketOption option)
void setPauseMode(PauseModes pauseMode)
bool waitForReadyRead(int msecs=30000) override
qint64 bytesToWrite() const override
qint64 readLineData(char *data, qint64 maxlen) override
bool waitForBytesWritten(int msecs=30000) override
virtual qintptr socketDescriptor() const
virtual bool waitForDisconnected(int msecs=30000)
QString protocolTag() const
void setSocketError(SocketError socketError)
void setPeerPort(quint16 port)
virtual ~QAbstractSocket()
qint64 bytesAvailable() const override
QHostAddress localAddress() const
qint64 skipData(qint64 maxSize) override
QNetworkProxy proxy() const
virtual bool bind(const QHostAddress &address, quint16 port=0, BindMode mode=DefaultForPlatform)
virtual bool waitForConnected(int msecs=30000)
PauseModes pauseMode() const
virtual void disconnectFromHost()
void setPeerAddress(const QHostAddress &address)
static constexpr auto UnknownNetworkLayerProtocol
void setProxy(const QNetworkProxy &networkProxy)
@ ReceiveBufferSizeSocketOption
@ MulticastLoopbackOption
@ SendBufferSizeSocketOption
static constexpr auto AnyIPProtocol
qint64 writeData(const char *data, qint64 len) override
qint64 readBufferSize() const
void setLocalPort(quint16 port)
void setProtocolTag(const QString &tag)
SocketType socketType() const
void setLocalAddress(const QHostAddress &address)
SocketState state() const
@ SocketAddressNotAvailableError
@ ProxyConnectionClosedError
@ ProxyConnectionRefusedError
@ ProxyConnectionTimeoutError
@ UnsupportedSocketOperationError
@ UnfinishedSocketOperationError
@ ProxyAuthenticationRequiredError
void setSocketState(SocketState state)
static constexpr auto IPv6Protocol
virtual void connectToHost(const QString &hostName, quint16 port, OpenMode mode=ReadWrite, NetworkLayerProtocol protocol=AnyIPProtocol)
quint16 localPort() const
void setPeerName(const QString &name)
SocketError error() const
QHostAddress peerAddress() const
virtual bool setSocketDescriptor(qintptr socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite)
qint64 readData(char *data, qint64 maxlen) override
bool canWriteNotification()
virtual ~QAbstractSocketPrivate()
QList< QHostAddress > addresses
void setError(QAbstractSocket::SocketError errorCode, const QString &errorString)
void emitBytesWritten(qint64 bytes, int channel=0)
QAbstractSocket::NetworkLayerProtocol preferredNetworkLayerProtocol
bool prePauseReadSocketNotifierState
void emitReadyRead(int channel=0)
void canCloseNotification()
QAbstractSocket::SocketError socketError
qintptr cachedSocketDescriptor
bool prePauseExceptionSocketNotifierState
QAbstractSocket::SocketType socketType
void fetchConnectionParameters()
static QAbstractSocketEngine * getSocketEngine(QAbstractSocket *)
void _q_startConnecting(const QHostInfo &hostInfo)
bool prePauseWriteSocketNotifierState
QAbstractSocketEngine * socketEngine
void startConnectingByName(const QString &host)
virtual bool canReadNotification()
void resolveProxy(const QString &hostName, quint16 port)
void _q_connectToNextAddress()
QHostAddress localAddress
virtual void configureCreatedSocket()
bool initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol)
static void pauseSocketNotifiers(QAbstractSocket *)
virtual bool writeToSocket()
virtual bool bind(const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode)
QAbstractSocket::SocketState state
void _q_abortConnectionAttempt()
static void resumeSocketNotifiers(QAbstractSocket *)
void connectionNotification() override
void setErrorAndEmit(QAbstractSocket::SocketError errorCode, const QString &errorString)
Type loadRelaxed() const noexcept
const char * constData() const noexcept
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
The QElapsedTimer class provides a fast way to calculate elapsed times.
qint64 elapsed() const noexcept
The QHostAddress class provides an IP address.\inmodule QtNetwork.
void setAddress(quint32 ip4Addr)
NetworkLayerProtocol protocol() const
The QHostInfo class provides static functions for host name lookups.
static void abortHostLookup(int lookupId)
static QHostInfo fromName(const QString &name)
QList< QHostAddress > addresses() const
The QIODevice class is the base interface class of all I/O devices in Qt.
virtual bool open(QIODeviceBase::OpenMode mode)
virtual qint64 size() const
QIODeviceBase::OpenMode openMode() const
virtual qint64 bytesAvailable() const
virtual qint64 skipData(qint64 maxSize)
virtual qint64 readLineData(char *data, qint64 maxlen)
virtual qint64 bytesToWrite() const
void readChannelFinished()
void write(const char *data, qint64 size)
bool allWriteBuffersEmpty() const
void setReadChannelCount(int count)
qint64 read(char *data, qint64 maxSize, bool peeking=false)
void setWriteChannelCount(int count)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
static QList< QNetworkProxy > proxyForQuery(const QNetworkProxyQuery &query)
The QNetworkProxy class provides a network layer proxy.
QNetworkProxy::ProxyType type() const
@ SctpTunnelingCapability
@ HostNameLookupCapability
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
QAtomicPointer< QThreadData > threadData
The QScopedValueRollback class resets a variable to its previous value on destruction.
The QString class provides a Unicode character string.
QByteArray toLatin1() const &
The QTimer class provides repetitive and single-shot timers.
The QVariant class acts like a union for the most common Qt data types.
backing_store_ptr info
[4]
Q_CORE_EXPORT QByteArray toPrintable(const char *data, int len, int maxSize)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
#define QABSTRACTSOCKET_BUFFERSIZE
EGLOutputLayerEXT EGLint EGLAttrib value
QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id)
int qt_subtract_from_timeout(int timeout, int elapsed)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
XmlOutput::xml_output tag(const QString &name)