From d0cd61dd25dcb01340ae257b861563bfca401fb9 Mon Sep 17 00:00:00 2001 From: Dennis van Amerongen Date: Sun, 25 Nov 2007 10:26:42 +0000 Subject: [PATCH] * modules/access_output/shout.c: let this be a lesson for all you kids out there - think before.. ehr.. sync before you shout! (in case the buffer isn't empty after reconnect approach, allows for smoother transition). --- modules/access_output/shout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/access_output/shout.c b/modules/access_output/shout.c index 6a1b725a30..52cf367aa7 100644 --- a/modules/access_output/shout.c +++ b/modules/access_output/shout.c @@ -492,12 +492,17 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer ) msg_Err( p_access, "cannot write to stream: %s", shout_get_error(p_access->p_sys->p_shout) ); - /* This can be caused by a server disconnect. Reconnecting might help... */ + /* The most common cause seems to be a server disconnect, resulting in a + Socket Error which can only be fixed by closing and reconnecting. + Since we already began with a working connection, the most feasable + approach to get out of this error status is a (timed) reconnect approach. */ shout_close( p_access->p_sys->p_shout ); msg_Warn( p_access, "server unavailable? waiting 30 seconds to reconnect..." ); msleep( 30000000 ); + /* Re-open the connection (protocol params have already been set) and re-sync */ if( shout_open( p_access->p_sys->p_shout ) == SHOUTERR_SUCCESS ) { + shout_sync( p_access->p_sys->p_shout ); msg_Warn( p_access, "reconnected to server" ); } else -- 2.39.5