scieck
7th May 2011, 11:04
Hi All,
it seems that when data is read from a QSslSocket for example using the readLine method the read data is left in the socket.
so when from the client using the same socket (some time later) more data is sent, the server reads first the data that was sent previously.
i.e.
1) connect with server (persistent connection)
2) client writes: action:add_group\n
3) server reads the line and does the action
4) some time later using the same socket the client sends: action:edit_group\n
5) now when the server reads from the socket it finds: action:add_group\n then the new action:edit_group\n after.
I thought that when data is read from a socket that data is also removed, but it does not seems the case.
Is there a way to read and remove data from a QSslSocket?
Or would it be better to use a new connection per each request ? (rather then persistent connection)
Many Thanks
Regards
_andrea
it seems that when data is read from a QSslSocket for example using the readLine method the read data is left in the socket.
so when from the client using the same socket (some time later) more data is sent, the server reads first the data that was sent previously.
i.e.
1) connect with server (persistent connection)
2) client writes: action:add_group\n
3) server reads the line and does the action
4) some time later using the same socket the client sends: action:edit_group\n
5) now when the server reads from the socket it finds: action:add_group\n then the new action:edit_group\n after.
I thought that when data is read from a socket that data is also removed, but it does not seems the case.
Is there a way to read and remove data from a QSslSocket?
Or would it be better to use a new connection per each request ? (rather then persistent connection)
Many Thanks
Regards
_andrea