2007-10-21 15:31:21 +02:00
|
|
|
/*
|
|
|
|
* protocoludp.h: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_SOCKET_H
|
|
|
|
#define __IPTV_SOCKET_H
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
class cIptvSocket {
|
|
|
|
protected:
|
|
|
|
int socketDesc;
|
2010-07-02 17:28:49 +02:00
|
|
|
int socketPort;
|
|
|
|
in_addr_t inetAddr;
|
2007-10-21 15:31:21 +02:00
|
|
|
struct sockaddr_in sockAddr;
|
|
|
|
bool isActive;
|
|
|
|
|
|
|
|
protected:
|
2010-07-02 17:28:49 +02:00
|
|
|
bool OpenSocket(const in_addr_t InetAddr, const int Port, const bool isUdp);
|
2007-10-21 15:31:21 +02:00
|
|
|
void CloseSocket(void);
|
|
|
|
|
|
|
|
public:
|
|
|
|
cIptvSocket();
|
|
|
|
virtual ~cIptvSocket();
|
|
|
|
};
|
|
|
|
|
2007-10-21 19:32:43 +02:00
|
|
|
class cIptvUdpSocket : public cIptvSocket {
|
|
|
|
public:
|
|
|
|
cIptvUdpSocket();
|
|
|
|
virtual ~cIptvUdpSocket();
|
2009-02-26 15:04:12 +01:00
|
|
|
virtual int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
2010-07-02 17:28:49 +02:00
|
|
|
bool OpenSocket(const in_addr_t InetAddr, const int Port);
|
2007-10-21 19:32:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class cIptvTcpSocket : public cIptvSocket {
|
|
|
|
public:
|
|
|
|
cIptvTcpSocket();
|
|
|
|
virtual ~cIptvTcpSocket();
|
2009-02-26 15:04:12 +01:00
|
|
|
virtual int Read(unsigned char* BufferAddr, unsigned int BufferLen);
|
2010-07-02 17:28:49 +02:00
|
|
|
bool OpenSocket(const in_addr_t InetAddr, const int Port);
|
2007-10-21 19:32:43 +02:00
|
|
|
};
|
|
|
|
|
2007-10-21 15:31:21 +02:00
|
|
|
#endif // __IPTV_SOCKET_H
|
|
|
|
|