$OpenBSD: patch-src_stream_c,v 1.2 2006/02/05 15:34:54 alek Exp $
--- src/stream.c.orig	Fri Nov  5 20:19:54 2004
+++ src/stream.c	Tue Nov 15 16:28:24 2005
@@ -295,9 +295,10 @@ void *ices_instance_stream(void *arg)
                             stream->reconnect_attempts==-1) && 
                             !ices_config->shutdown)
                     {
-                        i++;
                         LOG_WARN0("Trying reconnect after server socket error");
-                        shout_close(sdsc->shout);
+                        if(i == 0)
+                            shout_close(sdsc->shout);
+                        i++;
                         if((shouterr = shout_open(sdsc->shout)) == SHOUTERR_SUCCESS)
                         {
                             LOG_INFO3("Connected to server: %s:%d%s", 
