이 페이지에서

QTcpSocket Class

QTcpSocket 클래스는 TCP 소켓을 제공합니다. 더 보기...

헤더: #include <QTcpSocket>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network
상속: QAbstractSocket
상속받는 항목:

QSctpSocket 그리고 QSslSocket

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

공개 함수

QTcpSocket(QObject *parent = nullptr)
virtual ~QTcpSocket()

상세 설명

TCP(Transmission Control Protocol)는 신뢰할 수 있고, 스트림 지향적이며, 연결 지향적인 전송 프로토콜입니다. 특히 데이터의 연속적인 전송에 매우 적합합니다.

QTcpSocket는 QAbstractSocket 의 편리한 하위 클래스로, TCP 연결을 설정하고 데이터 스트림을 전송할 수 있게 해줍니다. 자세한 내용은 QAbstractSocket 문서를 참조하십시오.

참고: TCP 소켓은 QIODeviceBase::Unbuffered 모드에서는 열 수 없습니다.

QTcpServer, QUdpSocket, QNetworkAccessManager, Fortune Server, Fortune Client, Threaded Fortune Server, Blocking Fortune Client 및 Torrent 예제도참조하십시오 .

멤버 함수 문서

[explicit] QTcpSocket::QTcpSocket(QObject *parent = nullptr)

UnconnectedState 상태의 QTcpSocket 객체를 생성합니다.

parent QObject 생성자에 전달됩니다.

socketType()도 참조하십시오 .

[virtual noexcept] QTcpSocket::~QTcpSocket()

소켓을 삭제하며, 필요한 경우 연결을 종료합니다.

close()도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.