Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtcpsocket.h
Go to the documentation of this file.
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
13
14
16
17class Q_NETWORK_EXPORT QTcpSocket : public QAbstractSocket
18{
20public:
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
27 bool bind(QHostAddress::SpecialAddress addr, quint16 port = 0, BindMode mode = DefaultForPlatform)
28 { return bind(QHostAddress(addr), port, mode); }
29#endif
30
31protected:
32 QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = nullptr);
34 QObject *parent = nullptr);
35
36private:
37 Q_DISABLE_COPY_MOVE(QTcpSocket)
38 Q_DECLARE_PRIVATE(QTcpSocket)
39};
40
42
43#endif // QTCPSOCKET_H
The QAbstractSocket class provides the base functionality common to all socket types.
virtual bool bind(const QHostAddress &address, quint16 port=0, BindMode mode=DefaultForPlatform)
SocketType
This enum describes the transport layer protocol.
The QHostAddress class provides an IP address.
SpecialAddress
\value Null The null address object.
\inmodule QtCore
Definition qobject.h:103
The QTcpSocket class provides a TCP socket.
Definition qtcpsocket.h:18
Combined button and popup list for selecting options.
EGLOutputPortEXT port
static QT_BEGIN_NAMESPACE const char * socketType(QSocketNotifier::Type type)
GLenum mode
GLenum const void * addr
#define Q_OBJECT
unsigned short quint16
Definition qtypes.h:48
socketLayer bind(QHostAddress::Any, 4000)