diff --git a/protocolext.c b/protocolext.c index 112b918..ce9243c 100644 --- a/protocolext.c +++ b/protocolext.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocolext.c,v 1.19 2007/10/21 17:32:43 ajhseppa Exp $ + * $Id: protocolext.c,v 1.20 2007/10/21 19:32:14 ajhseppa Exp $ */ #include @@ -117,7 +117,7 @@ bool cIptvProtocolExt::Open(void) if (!strlen(scriptFile)) return false; // Create the listening socket - OpenSocket(socketPort, true); + OpenSocket(socketPort); // Execute the external script ExecuteScript(); isActive = true; diff --git a/protocolhttp.c b/protocolhttp.c index bc6149d..e7eda88 100644 --- a/protocolhttp.c +++ b/protocolhttp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocolhttp.c,v 1.19 2007/10/21 17:32:43 ajhseppa Exp $ + * $Id: protocolhttp.c,v 1.20 2007/10/21 19:32:14 ajhseppa Exp $ */ #include @@ -43,7 +43,7 @@ bool cIptvProtocolHttp::Connect(void) // Check that stream address is valid if (!isActive && !isempty(streamAddr) && !isempty(streamPath)) { // Ensure that socket is valid - OpenSocket(socketPort, false); + OpenSocket(socketPort); // First try only the IP address sockAddr.sin_addr.s_addr = inet_addr(streamAddr); diff --git a/protocoludp.c b/protocoludp.c index 14eb2ad..4f8037a 100644 --- a/protocoludp.c +++ b/protocoludp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocoludp.c,v 1.20 2007/10/21 17:32:43 ajhseppa Exp $ + * $Id: protocoludp.c,v 1.21 2007/10/21 19:32:15 ajhseppa Exp $ */ #include @@ -40,7 +40,7 @@ bool cIptvProtocolUdp::JoinMulticast(void) // Check that stream address is valid if (!isActive && !isempty(streamAddr)) { // Ensure that socket is valid - OpenSocket(socketPort, true); + OpenSocket(socketPort); // Join a new multicast group struct ip_mreq mreq; mreq.imr_multiaddr.s_addr = inet_addr(streamAddr); @@ -60,7 +60,7 @@ bool cIptvProtocolUdp::DropMulticast(void) // Check that stream address is valid if (isActive && !isempty(streamAddr)) { // Ensure that socket is valid - OpenSocket(socketPort, true); + OpenSocket(socketPort); // Drop the multicast group struct ip_mreq mreq; mreq.imr_multiaddr.s_addr = inet_addr(streamAddr); diff --git a/socket.c b/socket.c index 1118632..bd9e57d 100644 --- a/socket.c +++ b/socket.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: socket.c,v 1.3 2007/10/21 17:32:43 ajhseppa Exp $ + * $Id: socket.c,v 1.4 2007/10/21 19:32:15 ajhseppa Exp $ */ #include @@ -99,6 +99,12 @@ cIptvUdpSocket::~cIptvUdpSocket() debug("cIptvUdpSocket::~cIptvUdpSocket()\n"); } +bool cIptvUdpSocket::OpenSocket(const int Port) +{ + debug("cIptvUdpSocket::OpenSocket()\n"); + return cIptvSocket::OpenSocket(Port, true); +} + int cIptvUdpSocket::Read(unsigned char* *BufferAddr) { //debug("cIptvUdpSocket::Read()\n"); @@ -170,6 +176,12 @@ cIptvTcpSocket::~cIptvTcpSocket() debug("cIptvTcpSocket::~cIptvTcpSocket()\n"); } +bool cIptvTcpSocket::OpenSocket(const int Port) +{ + debug("cIptvTcpSocket::OpenSocket()\n"); + return cIptvSocket::OpenSocket(Port, false); +} + int cIptvTcpSocket::Read(unsigned char* *BufferAddr) { //debug("cIptvTcpSocket::Read()\n"); diff --git a/socket.h b/socket.h index 143f66a..81c89eb 100644 --- a/socket.h +++ b/socket.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: socket.h,v 1.2 2007/10/21 17:32:43 ajhseppa Exp $ + * $Id: socket.h,v 1.3 2007/10/21 19:32:15 ajhseppa Exp $ */ #ifndef __IPTV_SOCKET_H @@ -34,6 +34,7 @@ public: cIptvUdpSocket(); virtual ~cIptvUdpSocket(); virtual int Read(unsigned char* *BufferAddr); + bool OpenSocket(const int Port); }; class cIptvTcpSocket : public cIptvSocket { @@ -41,6 +42,7 @@ public: cIptvTcpSocket(); virtual ~cIptvTcpSocket(); virtual int Read(unsigned char* *BufferAddr); + bool OpenSocket(const int Port); }; #endif // __IPTV_SOCKET_H