This commit adds a consumer_socket object and a lock to access it. This
fixes the possible concurrent access to the consumer(s) socket between
threads in the session daemon.
This also introduce the use of a sequence number during streaming so the
relayd can know when to close the trace file according to the sent
versus the expected sequence number.
Introduce the close_stream command between the consumer and relayd. Upon
a destroy session or a stream that hung up, the consumer now sends the
close stream command indicating the last sequence number. The consumer
never closes the relayd sockets unless a destroy relayd command (new) is
received from the session daemon which occurs on a destroy session
command.
Some fixes here and there but overall the streaming synchronization
issues have been resolved.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>