Commit d0cd61dd authored by Dennis van Amerongen's avatar Dennis van Amerongen

* modules/access_output/shout.c: let this be a lesson for all you kids out...

* 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).
parent 6b4c45d2
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment