2007-09-16 11:38:00 +02:00
|
|
|
/*
|
|
|
|
* protocolhttp.h: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
2007-10-08 00:54:09 +02:00
|
|
|
* $Id: protocolhttp.h,v 1.7 2007/10/07 22:54:09 rahrenbe Exp $
|
2007-09-16 11:38:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_PROTOCOLHTTP_H
|
|
|
|
#define __IPTV_PROTOCOLHTTP_H
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include "protocolif.h"
|
|
|
|
|
|
|
|
class cIptvProtocolHttp : public cIptvProtocolIf {
|
|
|
|
private:
|
|
|
|
char* streamAddr;
|
2007-09-19 19:14:03 +02:00
|
|
|
char* streamPath;
|
2007-09-16 11:38:00 +02:00
|
|
|
int streamPort;
|
|
|
|
int socketDesc;
|
|
|
|
unsigned char* readBuffer;
|
2007-09-28 18:44:59 +02:00
|
|
|
unsigned int readBufferLen;
|
2007-09-16 11:38:00 +02:00
|
|
|
struct sockaddr_in sockAddr;
|
2007-09-26 21:49:35 +02:00
|
|
|
bool isActive;
|
2007-09-16 11:38:00 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool OpenSocket(const int Port);
|
|
|
|
void CloseSocket(void);
|
|
|
|
bool Connect(void);
|
|
|
|
bool Disconnect(void);
|
2007-09-29 12:55:14 +02:00
|
|
|
bool GetHeaderLine(char* dest, unsigned int destLen,
|
|
|
|
unsigned int &recvLen);
|
|
|
|
bool ProcessHeaders(void);
|
2007-09-16 11:38:00 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
cIptvProtocolHttp();
|
|
|
|
virtual ~cIptvProtocolHttp();
|
|
|
|
virtual int Read(unsigned char* *BufferAddr);
|
|
|
|
virtual bool Set(const char* Address, const int Port);
|
|
|
|
virtual bool Open(void);
|
|
|
|
virtual bool Close(void);
|
2007-10-08 00:54:09 +02:00
|
|
|
virtual cString GetInformation(void);
|
2007-09-16 11:38:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_PROTOCOLHTTP_H
|
|
|
|
|