[Icecast-dev] libshout : how to detect network connection lost

tech@viewsurf tech at viewsurf.com
Thu May 22 01:14:50 PDT 2008


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


More information about the Icecast-dev mailing list