added fault tolerance in case a server connection is dropped

This commit is contained in:
darkeye 2002-07-20 16:37:06 +00:00
parent e043b8784f
commit 229095cb7e
5 changed files with 34 additions and 16 deletions

View File

@ -4,6 +4,8 @@ DarkIce 0.10
encoding modes with specifying encoding quality as well. encoding modes with specifying encoding quality as well.
thanks to Nicu Pavel <npavel@ituner.com> thanks to Nicu Pavel <npavel@ituner.com>
o added support for Ogg Vorbis 1.0 final, removed support for rc2 o added support for Ogg Vorbis 1.0 final, removed support for rc2
o added fault tolerance: if one of several server connection drops,
DarkIce carries on with the rest of the servers still connected
09-04-2002: DarkIce 0.9.1 released 09-04-2002: DarkIce 0.9.1 released

View File

@ -283,23 +283,27 @@ Connector :: transfer ( unsigned long bytes,
for ( u = 0; u < numSinks; ++u ) { for ( u = 0; u < numSinks; ++u ) {
if ( sinks[u]->canWrite( sec, usec) ) { if ( sinks[u]->canWrite( sec, usec) ) {
try {
e = sinks[u]->write( buf, d); e = sinks[u]->write( buf, d);
} else { } catch ( Exception & e ) {
sinks[u]->close(); sinks[u]->close();
detach( sinks[u].get() ); detach( sinks[u].get() );
/* with the call to detach, numSinks gets 1 lower, /* with the call to detach, numSinks gets 1 lower,
* and the next sink comes to sinks[u] */ * and the next sink comes to sinks[u] */
--u; --u;
reportEvent( 5, reportEvent( 4,
"Connector :: transfer, sink removed, remaining", u); "Connector :: transfer, sink removed, remaining",
numSinks);
if ( numSinks == 0 ) { if ( numSinks == 0 ) {
reportEvent( 4, "Connector :: transfer, no more sinks"); reportEvent( 4,
"Connector :: transfer, no more sinks");
break; break;
} }
} }
} }
}
b += d; b += d;
} else { } else {
@ -334,6 +338,9 @@ Connector :: close ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.8 2002/07/20 16:37:06 darkeye
added fault tolerance in case a server connection is dropped
Revision 1.7 2002/05/28 12:35:41 darkeye Revision 1.7 2002/05/28 12:35:41 darkeye
code cleanup: compiles under gcc-c++ 3.1, using -pedantic option code cleanup: compiles under gcc-c++ 3.1, using -pedantic option

View File

@ -313,7 +313,7 @@ TcpSocket :: write ( const void * buf,
} }
// ret = send( sockfd, buf, len, MSG_DONTWAIT); // ret = send( sockfd, buf, len, MSG_DONTWAIT);
ret = send( sockfd, buf, len, 0); ret = send( sockfd, buf, len, MSG_NOSIGNAL);
if ( ret == -1 ) { if ( ret == -1 ) {
if ( errno == EAGAIN ) { if ( errno == EAGAIN ) {
@ -349,6 +349,9 @@ TcpSocket :: close ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.7 2002/07/20 16:37:06 darkeye
added fault tolerance in case a server connection is dropped
Revision 1.6 2001/09/18 16:44:10 darkeye Revision 1.6 2001/09/18 16:44:10 darkeye
TcpSocket did not report closed state when could not connect() TcpSocket did not report closed state when could not connect()

View File

@ -257,7 +257,7 @@ VorbisLibEncoder :: flush ( void )
* Send pending Vorbis blocks to the underlying stream * Send pending Vorbis blocks to the underlying stream
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
void void
VorbisLibEncoder :: vorbisBlocksOut ( void ) throw () VorbisLibEncoder :: vorbisBlocksOut ( void ) throw ( Exception )
{ {
while ( 1 == vorbis_analysis_blockout( &vorbisDspState, &vorbisBlock) ) { while ( 1 == vorbis_analysis_blockout( &vorbisDspState, &vorbisBlock) ) {
ogg_packet oggPacket; ogg_packet oggPacket;
@ -316,6 +316,9 @@ VorbisLibEncoder :: close ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.11 2002/07/20 16:37:06 darkeye
added fault tolerance in case a server connection is dropped
Revision 1.10 2002/07/20 10:59:00 darkeye Revision 1.10 2002/07/20 10:59:00 darkeye
added support for Ogg Vorbis 1.0, removed support for rc2 added support for Ogg Vorbis 1.0, removed support for rc2

View File

@ -171,7 +171,7 @@ class VorbisLibEncoder : public AudioEncoder, public virtual Reporter
* Send pending Vorbis blocks to the underlying stream * Send pending Vorbis blocks to the underlying stream
*/ */
void void
vorbisBlocksOut( void ) throw (); vorbisBlocksOut( void ) throw ( Exception );
protected: protected:
@ -445,6 +445,9 @@ class VorbisLibEncoder : public AudioEncoder, public virtual Reporter
$Source$ $Source$
$Log$ $Log$
Revision 1.6 2002/07/20 16:37:06 darkeye
added fault tolerance in case a server connection is dropped
Revision 1.5 2002/04/13 11:26:00 darkeye Revision 1.5 2002/04/13 11:26:00 darkeye
added cbr, abr and vbr setting feature with encoding quality added cbr, abr and vbr setting feature with encoding quality