The existing code reads each message from the socket individually and calls
engine_process_conns after each message. This seems inefficient as it leads
to excess calls engine_process_conns.
This changes the code that reads from the socket to read all available messages
before calling engine_process_conns based off of the logic in the reference
implementation.
reference: https://github.com/litespeedtech/lsquic/blob/master/bin/test_common.c#L737
The previous code did not have an implementation to set timers for processing
connections. This leads to an occasional deadlock where process_connections
must be called to continue. This change implements this timer modelled after
the lsquic reference implementation.
Reference: https://github.com/litespeedtech/lsquic/blob/master/bin/prog.c#L535