diff --git a/darkice/branches/darkice-rtp/ChangeLog b/darkice/branches/darkice-rtp/ChangeLog index d812df6..56472a7 100644 --- a/darkice/branches/darkice-rtp/ChangeLog +++ b/darkice/branches/darkice-rtp/ChangeLog @@ -132,7 +132,7 @@ Next release 20-10-2002: DarkIce 0.12 released - o ported to FreeBSD (removed reference to MSG_NOSIGNAL in TcpSocket.cpp) + o ported to FreeBSD (removed reference to MSG_NOSIGNAL in NetSocket.cpp) o bug fix: maximum bitrate setting fixed for Ogg Vorbis streams o changed internals so that now each encoding/server connection is a separate thread diff --git a/darkice/branches/darkice-rtp/src/CastSink.cpp b/darkice/branches/darkice-rtp/src/CastSink.cpp index 363bffe..9453179 100644 --- a/darkice/branches/darkice-rtp/src/CastSink.cpp +++ b/darkice/branches/darkice-rtp/src/CastSink.cpp @@ -54,7 +54,7 @@ static const char fileid[] = "$Id$"; * Initialize the object *----------------------------------------------------------------------------*/ void -CastSink :: init ( TcpSocket * socket, +CastSink :: init ( NetSocket * socket, Sink * streamDump, const char * password, unsigned int bitRate, diff --git a/darkice/branches/darkice-rtp/src/CastSink.h b/darkice/branches/darkice-rtp/src/CastSink.h index a513056..81735b1 100644 --- a/darkice/branches/darkice-rtp/src/CastSink.h +++ b/darkice/branches/darkice-rtp/src/CastSink.h @@ -39,7 +39,7 @@ #include "Ref.h" #include "Reporter.h" #include "Sink.h" -#include "TcpSocket.h" +#include "NetSocket.h" #include "BufferedSink.h" @@ -66,7 +66,7 @@ class CastSink : public Sink, public virtual Reporter /** * The socket connection to the server. */ - Ref socket; + Ref socket; /** * The BufferedSink encapsulating the socket connection to the server. @@ -128,7 +128,7 @@ class CastSink : public Sink, public virtual Reporter * @exception Exception */ void - init ( TcpSocket * socket, + init ( NetSocket * socket, Sink * streamDump, const char * password, unsigned int bitRate, @@ -182,11 +182,11 @@ class CastSink : public Sink, public virtual Reporter } /** - * Get the TcpSocket underneath this CastSink. + * Get the NetSocket underneath this CastSink. * - * @return pointer to the TcpSocket underneath this CastSink. + * @return pointer to the NetSocket underneath this CastSink. */ - inline TcpSocket * + inline NetSocket * getSocket ( void ) const throw () { return socket.get(); @@ -211,7 +211,7 @@ class CastSink : public Sink, public virtual Reporter * @exception Exception */ inline - CastSink ( TcpSocket * socket, + CastSink ( NetSocket * socket, const char * password, unsigned int bitRate, const char * name = 0, diff --git a/darkice/branches/darkice-rtp/src/DarkIce.cpp b/darkice/branches/darkice-rtp/src/DarkIce.cpp index 0438473..6ff4cfe 100644 --- a/darkice/branches/darkice-rtp/src/DarkIce.cpp +++ b/darkice/branches/darkice-rtp/src/DarkIce.cpp @@ -345,7 +345,7 @@ DarkIce :: configIceCast ( const Config & config, } } // streaming related stuff - audioOuts[u].socket = new TcpSocket( server, port); + audioOuts[u].socket = new NetSocket( server, port); audioOuts[u].server = new IceCast( audioOuts[u].socket.get(), password, mountPoint, @@ -558,7 +558,7 @@ DarkIce :: configIceCast2 ( const Config & config, } // streaming related stuff - audioOuts[u].socket = new TcpSocket( server, port); + audioOuts[u].socket = new NetSocket( server, port); audioOuts[u].server = new IceCast2( audioOuts[u].socket.get(), password, mountPoint, @@ -829,7 +829,7 @@ DarkIce :: configShoutCast ( const Config & config, } // streaming related stuff - audioOuts[u].socket = new TcpSocket( server, port); + audioOuts[u].socket = new NetSocket( server, port); audioOuts[u].server = new ShoutCast( audioOuts[u].socket.get(), password, mountPoint, diff --git a/darkice/branches/darkice-rtp/src/DarkIce.h b/darkice/branches/darkice-rtp/src/DarkIce.h index bdeac5e..df58b0d 100644 --- a/darkice/branches/darkice-rtp/src/DarkIce.h +++ b/darkice/branches/darkice-rtp/src/DarkIce.h @@ -56,7 +56,7 @@ #include "BufferedSink.h" #include "Connector.h" #include "AudioEncoder.h" -#include "TcpSocket.h" +#include "NetSocket.h" #include "CastSink.h" #include "DarkIceConfig.h" @@ -90,7 +90,7 @@ class DarkIce : public virtual Referable, public virtual Reporter */ typedef struct { Ref encoder; - Ref socket; + Ref socket; Ref server; } Output; diff --git a/darkice/branches/darkice-rtp/src/IceCast.h b/darkice/branches/darkice-rtp/src/IceCast.h index 18afd24..5ab9805 100644 --- a/darkice/branches/darkice-rtp/src/IceCast.h +++ b/darkice/branches/darkice-rtp/src/IceCast.h @@ -37,7 +37,7 @@ /* ============================================================ include files */ #include "Sink.h" -#include "TcpSocket.h" +#include "NetSocket.h" #include "CastSink.h" @@ -143,7 +143,7 @@ class IceCast : public CastSink * @exception Exception */ inline - IceCast ( TcpSocket * socket, + IceCast ( NetSocket * socket, const char * password, const char * mountPoint, unsigned int bitRate, diff --git a/darkice/branches/darkice-rtp/src/IceCast2.h b/darkice/branches/darkice-rtp/src/IceCast2.h index 483e749..802180d 100644 --- a/darkice/branches/darkice-rtp/src/IceCast2.h +++ b/darkice/branches/darkice-rtp/src/IceCast2.h @@ -37,7 +37,7 @@ /* ============================================================ include files */ #include "Sink.h" -#include "TcpSocket.h" +#include "NetSocket.h" #include "CastSink.h" @@ -151,7 +151,7 @@ class IceCast2 : public CastSink * @exception Exception */ inline - IceCast2 ( TcpSocket * socket, + IceCast2 ( NetSocket * socket, const char * password, const char * mountPoint, StreamFormat format, diff --git a/darkice/branches/darkice-rtp/src/Makefile.am b/darkice/branches/darkice-rtp/src/Makefile.am index 9ffdabf..d82cc1c 100644 --- a/darkice/branches/darkice-rtp/src/Makefile.am +++ b/darkice/branches/darkice-rtp/src/Makefile.am @@ -62,8 +62,8 @@ darkice_SOURCES = AudioEncoder.h\ Referable.h\ Sink.h\ Source.h\ - TcpSocket.cpp\ - TcpSocket.h\ + NetSocket.cpp\ + NetSocket.h\ Util.cpp\ Util.h\ ConfigSection.h\ diff --git a/darkice/branches/darkice-rtp/src/TcpSocket.cpp b/darkice/branches/darkice-rtp/src/NetSocket.cpp similarity index 94% rename from darkice/branches/darkice-rtp/src/TcpSocket.cpp rename to darkice/branches/darkice-rtp/src/NetSocket.cpp index 28046f4..ced259b 100644 --- a/darkice/branches/darkice-rtp/src/TcpSocket.cpp +++ b/darkice/branches/darkice-rtp/src/NetSocket.cpp @@ -4,7 +4,7 @@ Tyrell DarkIce - File : TcpSocket.cpp + File : NetSocket.cpp Version : $Revision$ Author : $Author$ Location : $HeadURL$ @@ -90,7 +90,7 @@ #include "Util.h" #include "Exception.h" -#include "TcpSocket.h" +#include "NetSocket.h" /* =================================================== local data structures */ @@ -113,7 +113,7 @@ static const char fileid[] = "$Id$"; * Initialize the object *----------------------------------------------------------------------------*/ void -TcpSocket :: init ( const char * host, +NetSocket :: init ( const char * host, unsigned short port ) throw ( Exception ) { this->host = Util::strDup( host); @@ -126,7 +126,7 @@ TcpSocket :: init ( const char * host, * De-initialize the object *----------------------------------------------------------------------------*/ void -TcpSocket :: strip ( void) throw ( Exception ) +NetSocket :: strip ( void) throw ( Exception ) { if ( isOpen() ) { close(); @@ -139,7 +139,7 @@ TcpSocket :: strip ( void) throw ( Exception ) /*------------------------------------------------------------------------------ * Copy Constructor *----------------------------------------------------------------------------*/ -TcpSocket :: TcpSocket ( const TcpSocket & ss ) throw ( Exception ) +NetSocket :: NetSocket ( const NetSocket & ss ) throw ( Exception ) : Source( ss), Sink( ss ) { int fd; @@ -158,8 +158,8 @@ TcpSocket :: TcpSocket ( const TcpSocket & ss ) throw ( Exception ) /*------------------------------------------------------------------------------ * Assignment operator *----------------------------------------------------------------------------*/ -TcpSocket & -TcpSocket :: operator= ( const TcpSocket & ss ) throw ( Exception ) +NetSocket & +NetSocket :: operator= ( const NetSocket & ss ) throw ( Exception ) { if ( this != &ss ) { int fd; @@ -190,7 +190,7 @@ TcpSocket :: operator= ( const TcpSocket & ss ) throw ( Exception ) * Open the file *----------------------------------------------------------------------------*/ bool -TcpSocket :: open ( void ) throw ( Exception ) +NetSocket :: open ( void ) throw ( Exception ) { int optval; socklen_t optlen; @@ -259,7 +259,7 @@ TcpSocket :: open ( void ) throw ( Exception ) * Check wether read() would return anything *----------------------------------------------------------------------------*/ bool -TcpSocket :: canRead ( unsigned int sec, +NetSocket :: canRead ( unsigned int sec, unsigned int usec ) throw ( Exception ) { fd_set fdset; @@ -297,7 +297,7 @@ TcpSocket :: canRead ( unsigned int sec, * Read from the socket *----------------------------------------------------------------------------*/ unsigned int -TcpSocket :: read ( void * buf, +NetSocket :: read ( void * buf, unsigned int len ) throw ( Exception ) { int ret; @@ -332,7 +332,7 @@ TcpSocket :: read ( void * buf, * Check wether read() would return anything *----------------------------------------------------------------------------*/ bool -TcpSocket :: canWrite ( unsigned int sec, +NetSocket :: canWrite ( unsigned int sec, unsigned int usec ) throw ( Exception ) { fd_set fdset; @@ -370,7 +370,7 @@ TcpSocket :: canWrite ( unsigned int sec, * Write to the socket *----------------------------------------------------------------------------*/ unsigned int -TcpSocket :: write ( const void * buf, +NetSocket :: write ( const void * buf, unsigned int len ) throw ( Exception ) { int ret; @@ -403,7 +403,7 @@ TcpSocket :: write ( const void * buf, * Close the socket *----------------------------------------------------------------------------*/ void -TcpSocket :: close ( void ) throw ( Exception ) +NetSocket :: close ( void ) throw ( Exception ) { if ( !isOpen() ) { return; diff --git a/darkice/branches/darkice-rtp/src/TcpSocket.h b/darkice/branches/darkice-rtp/src/NetSocket.h similarity index 86% rename from darkice/branches/darkice-rtp/src/TcpSocket.h rename to darkice/branches/darkice-rtp/src/NetSocket.h index 789ef52..8342ab6 100644 --- a/darkice/branches/darkice-rtp/src/TcpSocket.h +++ b/darkice/branches/darkice-rtp/src/NetSocket.h @@ -4,7 +4,7 @@ Tyrell DarkIce - File : TcpSocket.h + File : NetSocket.h Version : $Revision$ Author : $Author$ Location : $HeadURL$ @@ -55,7 +55,7 @@ * @author $Author$ * @version $Revision$ */ -class TcpSocket : public Source, public Sink, public virtual Reporter +class NetSocket : public Source, public Sink, public virtual Reporter { private: @@ -102,7 +102,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter * @exception Exception */ inline - TcpSocket ( void ) throw ( Exception ) + NetSocket ( void ) throw ( Exception ) { throw Exception( __FILE__, __LINE__); } @@ -118,7 +118,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter * @exception Exception */ inline - TcpSocket( const char * host, + NetSocket( const char * host, unsigned short port ) throw ( Exception ) { init( host, port); @@ -127,10 +127,10 @@ class TcpSocket : public Source, public Sink, public virtual Reporter /** * Copy constructor. * - * @param ss the TcpSocket to copy. + * @param ss the NetSocket to copy. * @exception Exception */ - TcpSocket( const TcpSocket & ss ) throw ( Exception ); + NetSocket( const NetSocket & ss ) throw ( Exception ); /** * Destructor. @@ -138,7 +138,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter * @exception Exception */ inline virtual - ~TcpSocket( void ) throw ( Exception ) + ~NetSocket( void ) throw ( Exception ) { strip(); } @@ -146,12 +146,12 @@ class TcpSocket : public Source, public Sink, public virtual Reporter /** * Assignment operator. * - * @param ss the TcpSocket to assign this to. - * @return a reference to this TcpSocket. + * @param ss the NetSocket to assign this to. + * @return a reference to this NetSocket. * @exception Exception */ - inline virtual TcpSocket & - operator= ( const TcpSocket & ss ) throw ( Exception ); + inline virtual NetSocket & + operator= ( const NetSocket & ss ) throw ( Exception ); /** * Get the host this socket connects to. @@ -176,7 +176,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter } /** - * Open the TcpSocket. + * Open the NetSocket. * * @return true if opening was successfull, false otherwise. * @exception Exception @@ -185,9 +185,9 @@ class TcpSocket : public Source, public Sink, public virtual Reporter open ( void ) throw ( Exception ); /** - * Check if the TcpSocket is open. + * Check if the NetSocket is open. * - * @return true if the TcpSocket is open, false otherwise. + * @return true if the NetSocket is open, false otherwise. */ inline virtual bool isOpen ( void ) const throw () @@ -201,7 +201,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter * * @param sec the maximum seconds to block. * @param usec micro seconds to block after the full seconds. - * @return true if the TcpSocket is ready to be read from, + * @return true if the NetSocket is ready to be read from, * false otherwise. * @exception Exception */ @@ -210,7 +210,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter unsigned int usec ) throw ( Exception ); /** - * Read from the TcpSocket. + * Read from the NetSocket. * * @param buf the buffer to read into. * @param len the number of bytes to read into buf @@ -223,12 +223,12 @@ class TcpSocket : public Source, public Sink, public virtual Reporter /** - * Check if the TcpSocket is ready to accept data. + * Check if the NetSocket is ready to accept data. * Blocks until the specified time for data to be available. * * @param sec the maximum seconds to block. * @param usec micro seconds to block after the full seconds. - * @return true if the TcpSocket is ready to accept data, + * @return true if the NetSocket is ready to accept data, * false otherwise. * @exception Exception */ @@ -237,7 +237,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter unsigned int usec ) throw ( Exception ); /** - * Write data to the TcpSocket. + * Write data to the NetSocket. * * @param buf the data to write. * @param len number of bytes to write from buf. @@ -249,7 +249,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter unsigned int len ) throw ( Exception ); /** - * Flush all data that was written to the TcpSocket to the underlying + * Flush all data that was written to the NetSocket to the underlying * connection. * * @exception Exception @@ -264,7 +264,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter * This usually means separating the data sent to the sink up * until now, and start saving a new chunk of data. * - * For TcpSocket, this is a no-op. + * For NetSocket, this is a no-op. */ inline virtual void cut ( void ) throw () @@ -272,7 +272,7 @@ class TcpSocket : public Source, public Sink, public virtual Reporter } /** - * Close the TcpSocket. + * Close the NetSocket. * * @exception Exception */ diff --git a/darkice/branches/darkice-rtp/src/ShoutCast.h b/darkice/branches/darkice-rtp/src/ShoutCast.h index 5703ee1..4501bad 100644 --- a/darkice/branches/darkice-rtp/src/ShoutCast.h +++ b/darkice/branches/darkice-rtp/src/ShoutCast.h @@ -37,7 +37,7 @@ /* ============================================================ include files */ #include "Sink.h" -#include "TcpSocket.h" +#include "NetSocket.h" #include "CastSink.h" @@ -151,7 +151,7 @@ class ShoutCast : public CastSink * @exception Exception */ inline - ShoutCast ( TcpSocket * socket, + ShoutCast ( NetSocket * socket, const char * password, const char * mountPoint, unsigned int bitRate,