From 87f7057a5d59dcddb1f5f54c4013ec1ae0014a93 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 14 Nov 2015 17:07:02 +0100 Subject: issue a warning when a client is too slow and about to get disconnected, #16 --- voctocore/lib/avrawoutput.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'voctocore/lib/avrawoutput.py') diff --git a/voctocore/lib/avrawoutput.py b/voctocore/lib/avrawoutput.py index f7dcdf4..ee77c4d 100644 --- a/voctocore/lib/avrawoutput.py +++ b/voctocore/lib/avrawoutput.py @@ -58,7 +58,12 @@ class AVRawOutput(TCPMultiConnection): self.log.debug('fd %u removed from multifdsink', fileno) self.close_connection(conn) + def on_about_to_disconnect(multifdsink, fileno, status): + if fileno == conn.fileno() and status == 3: # Gst.MultiHandleSinkClientStatus.Slow + self.log.warning('about to remove fd %u from multifdsink because it is too slow!', fileno) + fdsink.connect('client-fd-removed', on_disconnect) + fdsink.connect('client-removed', on_about_to_disconnect) def on_eos(self, bus, message): self.log.debug('Received End-of-Stream-Signal on Output-Pipeline') -- cgit v1.2.3