tech@viewsurf
2008-May-22 08:14 UTC
[Icecast-dev] libshout : how to detect network connection lost
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