Qt 4.8
Macros | Functions
qabstractsocket.cpp File Reference
#include "qabstractsocket.h"
#include "qabstractsocket_p.h"
#include "private/qhostinfo_p.h"
#include "private/qnetworksession_p.h"
#include <qabstracteventdispatcher.h>
#include <qhostaddress.h>
#include <qhostinfo.h>
#include <qmetaobject.h>
#include <qpointer.h>
#include <qtimer.h>
#include <qelapsedtimer.h>
#include <qscopedvaluerollback.h>
#include <QtNetwork/qsslsocket.h>
#include <private/qthread_p.h>
#include <time.h>
#include "moc_qabstractsocket.cpp"

Go to the source code of this file.

Macros

#define Q_CHECK_SOCKETENGINE(returnValue)
 
#define QABSTRACTSOCKET_BUFFERSIZE   32768
 
#define QT_CONNECT_TIMEOUT   30000
 
#define QT_TRANSFER_TIMEOUT   120000
 

Functions

static bool isProxyError (QAbstractSocket::SocketError error)
 
Q_NETWORK_EXPORT QDebug operator<< (QDebug debug, QAbstractSocket::SocketError error)
 
Q_NETWORK_EXPORT QDebug operator<< (QDebug debug, QAbstractSocket::SocketState state)
 
static int qt_timeout_value (int msecs, int elapsed)
 

Macro Definition Documentation

◆ Q_CHECK_SOCKETENGINE

#define Q_CHECK_SOCKETENGINE (   returnValue)
Value:
do { \
if (!d->socketEngine) { \
return returnValue; \
} } while (0)
double d
Definition: qnumeric_p.h:62

Definition at line 429 of file qabstractsocket.cpp.

Referenced by QAbstractSocket::flush().

◆ QABSTRACTSOCKET_BUFFERSIZE

#define QABSTRACTSOCKET_BUFFERSIZE   32768

Definition at line 435 of file qabstractsocket.cpp.

◆ QT_CONNECT_TIMEOUT

#define QT_CONNECT_TIMEOUT   30000

◆ QT_TRANSFER_TIMEOUT

#define QT_TRANSFER_TIMEOUT   120000

Definition at line 438 of file qabstractsocket.cpp.

Function Documentation

◆ isProxyError()

static bool isProxyError ( QAbstractSocket::SocketError  error)
static

◆ operator<<() [1/2]

Q_NETWORK_EXPORT QDebug operator<< ( QDebug  debug,
QAbstractSocket::SocketError  error 
)

Definition at line 2957 of file qabstractsocket.cpp.

2958 {
2959  switch (error) {
2961  debug << "QAbstractSocket::ConnectionRefusedError";
2962  break;
2964  debug << "QAbstractSocket::RemoteHostClosedError";
2965  break;
2967  debug << "QAbstractSocket::HostNotFoundError";
2968  break;
2970  debug << "QAbstractSocket::SocketAccessError";
2971  break;
2973  debug << "QAbstractSocket::SocketResourceError";
2974  break;
2976  debug << "QAbstractSocket::SocketTimeoutError";
2977  break;
2979  debug << "QAbstractSocket::DatagramTooLargeError";
2980  break;
2982  debug << "QAbstractSocket::NetworkError";
2983  break;
2985  debug << "QAbstractSocket::AddressInUseError";
2986  break;
2988  debug << "QAbstractSocket::SocketAddressNotAvailableError";
2989  break;
2991  debug << "QAbstractSocket::UnsupportedSocketOperationError";
2992  break;
2994  debug << "QAbstractSocket::UnfinishedSocketOperationError";
2995  break;
2997  debug << "QAbstractSocket::ProxyAuthenticationRequiredError";
2998  break;
3000  debug << "QAbstractSocket::UnknownSocketError";
3001  break;
3003  debug << "QAbstractSocket::ProxyConnectionRefusedError";
3004  break;
3006  debug << "QAbstractSocket::ProxyConnectionClosedError";
3007  break;
3009  debug << "QAbstractSocket::ProxyConnectionTimeoutError";
3010  break;
3012  debug << "QAbstractSocket::ProxyNotFoundError";
3013  break;
3015  debug << "QAbstractSocket::ProxyProtocolError";
3016  break;
3017  default:
3018  debug << "QAbstractSocket::SocketError(" << int(error) << ')';
3019  break;
3020  }
3021  return debug;
3022 }
#define error(msg)

◆ operator<<() [2/2]

Q_NETWORK_EXPORT QDebug operator<< ( QDebug  debug,
QAbstractSocket::SocketState  state 
)

Definition at line 3024 of file qabstractsocket.cpp.

3025 {
3026  switch (state) {
3028  debug << "QAbstractSocket::UnconnectedState";
3029  break;
3031  debug << "QAbstractSocket::HostLookupState";
3032  break;
3034  debug << "QAbstractSocket::ConnectingState";
3035  break;
3037  debug << "QAbstractSocket::ConnectedState";
3038  break;
3040  debug << "QAbstractSocket::BoundState";
3041  break;
3043  debug << "QAbstractSocket::ListeningState";
3044  break;
3046  debug << "QAbstractSocket::ClosingState";
3047  break;
3048  default:
3049  debug << "QAbstractSocket::SocketState(" << int(state) << ')';
3050  break;
3051  }
3052  return debug;
3053 }

◆ qt_timeout_value()

static int qt_timeout_value ( int  msecs,
int  elapsed 
)
static

Definition at line 1820 of file qabstractsocket.cpp.

Referenced by QAbstractSocket::waitForBytesWritten(), QAbstractSocket::waitForConnected(), QAbstractSocket::waitForDisconnected(), and QAbstractSocket::waitForReadyRead().

1821 {
1822  if (msecs == -1)
1823  return -1;
1824 
1825  int timeout = msecs - elapsed;
1826  return timeout < 0 ? 0 : timeout;
1827 }
static double elapsed(qint64 after, qint64 before)