Randy McAnally
2008-May-22 19:08 UTC
[Icecast-dev] libshout : how to detect network connection lost
I noticed the same problem in the Perl wrappers since many years ago. I ended up wrapping the libshout portion of the perl code in an eval/alarm to detect the hang and restart the libshout thread as needed. -- Randy Fast Serv Networks, LLC> Message: 1 > Date: Thu, 22 May 2008 10:14:50 +0200 > From: "tech at viewsurf" <tech at viewsurf.com> > Subject: [Icecast-dev] libshout : how to detect network connection > lost > To: Icecast-dev at xiph.org > Message-ID: <48352B7A.9010208 at viewsurf.com> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Hello everybody, > > I'm using a software of my own that uses libshout to send an ogg > stream to my icecast server. > > While transmitting the stream, if i unplug the network cable or stop > the network interface, the soft hangs on shout_send. There seems to > be no timeout (or, at least, i've let it run for 10mins without > seeing any timeout). > > Is there a way to detect such events using libshout or do i have to > put a timeout on the send function? > > here is the piece of code for the send function : > > shout_sync(m_shout); > int ret = shout_send(m_shout, (unsigned char*)buf, buflen); > if(ret != SHOUTERR_SUCCESS) { > Logger::log("Shout::send shout send error\n"); > return false; > } > return true; > > Thanks for any advice > > Florian > > ------------------------------ > > _______________________________________________ > Icecast-dev mailing list > Icecast-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-dev > > End of Icecast-dev Digest, Vol 47, Issue 2 > ******************************************------- End of Original Message -------
tech@viewsurf
2008-May-23 08:07 UTC
[Icecast-dev] libshout : how to detect network connection lost
Randy McAnally a ?crit :> I noticed the same problem in the Perl wrappers since many years ago. I > ended up wrapping the libshout portion of the perl code in an eval/alarm to > detect the hang and restart the libshout thread as needed. >Thanks for the answer. I've modified my code to use the non blocking api of libshout. Hence, i check the return value of shout_queuelen and exit if it's too high. Thanks Florian