There is currently no support for using QTcp socket half duplex/one way.
I'm working with QTcpServer and QTcpSocket for making a server. Other side there is a client written in C, which calls shutdown(socket, SD_SEND); after writing request, so it only expects data from server.
- WinSock 2 extension – manifest constants for shutdown()
*/#define SD_RECEIVE 0x00}}
#define SD_SEND 0x01
#define SD_BOTH 0x02
The qTcp socket I have on the server side immediately closes the connection (QTcpSocket::disconnected signal fired) without waiting to send data. I went through the Qt documentation and the forum in detail, but couldn't find any information. I'm starting to think that Qt doesn't support half duplex connections.
In my opinion, qt tcp socket should check the content of the incoming fin message and decide whether to close the socket according to its content. Currently, the tcp socket is closing, although the incoming fin message contains only a one-way shutdown (SD_SEND).
Is my assumption true ? Is qt doesn't support half-duplex tcp usage ? Is this a bug or a feature? And are you considering a solution?
Example code on client side: