QTcpSocket Class
The QTcpSocket class provides a TCP socket. More...
Header: | #include <QTcpSocket> |
qmake: | QT += network |
Inherits: | QAbstractSocket |
Inherited By: |
Note: All functions in this class are reentrant.
Public Functions
QTcpSocket(QObject *parent = nullptr) | |
virtual | ~QTcpSocket() |
- 39 public functions inherited from QAbstractSocket
- 44 public functions inherited from QIODevice
- 30 public functions inherited from QObject
Related Non-Members
typedef | QObjectList |
QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
T | qobject_cast(QObject *object) |
T | qobject_cast(const QObject *object) |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Q_CLASSINFO(Name, Value) | |
Q_DISABLE_COPY(Class) | |
Q_DISABLE_COPY_MOVE(Class) | |
Q_DISABLE_MOVE(Class) | |
Q_EMIT | |
Q_ENUM(...) | |
Q_ENUM_NS(...) | |
Q_FLAG(...) | |
Q_FLAG_NS(...) | |
Q_GADGET | |
Q_INTERFACES(...) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(...) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 6 signals inherited from QAbstractSocket
- 6 signals inherited from QIODevice
- 2 signals inherited from QObject
- 9 static public members inherited from QObject
- 10 protected functions inherited from QAbstractSocket
- 5 protected functions inherited from QIODevice
- 9 protected functions inherited from QObject
Detailed Description
TCP (Transmission Control Protocol) is a reliable, stream-oriented, connection-oriented transport protocol. It is especially well suited for continuous transmission of data.
QTcpSocket is a convenience subclass of QAbstractSocket that allows you to establish a TCP connection and transfer streams of data. See the QAbstractSocket documentation for details.
Note: TCP sockets cannot be opened in QIODevice::Unbuffered mode.
See also QTcpServer, QUdpSocket, QNetworkAccessManager, Fortune Server Example, Fortune Client Example, Threaded Fortune Server Example, Blocking Fortune Client Example, Loopback Example, and Torrent Example.
Member Function Documentation
QTcpSocket::QTcpSocket(QObject *parent = nullptr)
Creates a QTcpSocket object in state UnconnectedState
.
parent is passed on to the QObject constructor.
See also socketType().
[virtual]
QTcpSocket::~QTcpSocket()
Destroys the socket, closing the connection if necessary.
See also close().