C
C
cats722019-06-21 13:48:45
Qt
cats72, 2019-06-21 13:48:45

How to close QTcpSocket gracefully?

Good afternoon! Tell me, is there an analogue of the shutdown function for QTcpSocket as in BSD sockets? Or how can QTcpSocket be closed to receive data (what is shutdown(socket, SD_SEND))?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2019-10-21
@IGHOR

QTcpSocket does what it needs to do when the destructor is called.
The main thing is that the constructor and destructor, reading and writing, are called in the same thread.
And if something is missing, you can get the descriptor using the socketDescriptor() method and use the find API on top of it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question