| 1 | // Copyright (C) 2016 The Qt Company Ltd. | 
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 | |
| 4 | #ifndef QTCPSOCKET_H | 
| 5 | #define QTCPSOCKET_H | 
| 6 | |
| 7 | #include <QtNetwork/qtnetworkglobal.h> | 
| 8 | #include <QtNetwork/qabstractsocket.h> | 
| 9 | #include <QtNetwork/qhostaddress.h> | 
| 10 | #include <QtCore/qvariant.h> | 
| 11 | |
| 12 | QT_BEGIN_NAMESPACE | 
| 13 | |
| 14 | |
| 15 | class QTcpSocketPrivate; | 
| 16 | |
| 17 | class Q_NETWORK_EXPORT QTcpSocket : public QAbstractSocket | 
| 18 | { | 
| 19 | Q_OBJECT | 
| 20 | public: | 
| 21 | explicit QTcpSocket(QObject *parent = nullptr); | 
| 22 | virtual ~QTcpSocket(); | 
| 23 | |
| 24 | #if QT_VERSION < QT_VERSION_CHECK(7,0,0) && !defined(Q_QDOC) | 
| 25 | // ### Qt7: move into QAbstractSocket | 
| 26 | using QAbstractSocket::bind; | 
| 27 | bool bind(QHostAddress::SpecialAddress addr, quint16 port = 0, BindMode mode = DefaultForPlatform) | 
| 28 | { return bind(address: QHostAddress(addr), port, mode); } | 
| 29 | #endif | 
| 30 | |
| 31 | protected: | 
| 32 | QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = nullptr); | 
| 33 | QTcpSocket(QAbstractSocket::SocketType socketType, QTcpSocketPrivate &dd, | 
| 34 | QObject *parent = nullptr); | 
| 35 | |
| 36 | private: | 
| 37 | Q_DISABLE_COPY_MOVE(QTcpSocket) | 
| 38 | Q_DECLARE_PRIVATE(QTcpSocket) | 
| 39 | }; | 
| 40 | |
| 41 | QT_END_NAMESPACE | 
| 42 | |
| 43 | #endif // QTCPSOCKET_H | 
| 44 | 
