Dinh Le wrote:
But this hack does not work since the previously received message may
be less than 1024 bytes long but there are still more data available
for receiving.  Worse yet, gnutls_record_recv() would hang indefinitely
if there's no data available to be received.

You will need to use non-blocking I/O if you want to do multiple reads without hanging.

You have two options:
1. Add large static buffers and do one read.
2. Use non-blocking I/O and do multiple reads in blocks (the size can be up to you) and dynamically allocate memory to receive an unknown size data packet.

_______________________________________________
Help-gnutls mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-gnutls

Reply via email to