QTcpSocket internal buffer
-
Hope you are asking about internal socket buffer. When the close issued, all the segments preceding the current close request will sent to remote end. Hope that's what you are asking here. Please note Qt may not have any role to play when close is issued. It may just call close of the socket end point.
-
[quote author="Dheerendra" date="1408776187"]Hope you are asking about internal socket buffer. When the close issued, all the segments preceding the current close request will sent to remote end. Hope that's what you are asking here. Please note Qt may not have any role to play when close is issued. It may just call close of the socket end point.[/quote]
Yes, sorry. That's what I meant.
What do you mean by "all the segments preceding the current close request will sent to remote end"?And does this have anything to do with why QTcpSocket::size() becomes 0 after I call close()?
-
Once socket close is issued, close segment is sent to peer end-point. It means to indicate that this side has no data to send. At the same time other endpoint also has to issue close if it does not want to send the data.
Preceding current close means that what ever the data segments you put before the socket close should be delivered to remote-end.
If you are seeing size as zero means that there is not data from the other end. It is nothing to do with close issued from this end.
-
-
What do you mean by newConnection ? Is it the same client with same port# to server with same port# ? This can't happen immediately. There is time duration(MST) defined by TCP before which TCP will not allow same connection. After this old data will not have any relevance and gets discarded.
Yes readAll reads all data and clears everything.