hlswmaster-ng/hlswserver.h

45 lines
703 B
C
Raw Normal View History

2006-02-02 16:55:44 +01:00
#ifndef _HLSWSERVER_H_
#define _HLSWSERVER_H_
#include <string.h>
#include "thread.h"
#include "config.h"
#include "gamelist.h"
2006-02-06 20:58:32 +01:00
#include "mutex.h"
2006-02-02 16:55:44 +01:00
class HlswServer : public Thread {
public:
2006-02-19 18:45:56 +01:00
HlswServer(Config& conf);
2006-02-02 16:55:44 +01:00
~HlswServer();
int execute(void* arg);
2006-02-19 18:45:56 +01:00
void rebuild(GameList& glist);
2006-02-02 16:55:44 +01:00
protected:
HlswServer(const HlswServer& hs);
HlswServer& operator=(const HlswServer& hs);
private:
class HlswPacket {
public:
2006-02-06 20:58:32 +01:00
HlswPacket(HlswPacket* next);
~HlswPacket();
2006-02-02 16:55:44 +01:00
2006-02-19 18:45:56 +01:00
bool addGame(GameEntry* ge);
2006-02-06 20:58:32 +01:00
void send(int socket, struct sockaddr_in* dst);
2006-02-02 16:55:44 +01:00
2006-02-06 20:58:32 +01:00
private:
2006-02-02 16:55:44 +01:00
HlswPacket* next;
int count;
2006-02-06 20:58:32 +01:00
char data[1418];
2006-02-02 16:55:44 +01:00
};
2006-02-06 20:58:32 +01:00
HlswPacket* pktlist;
Mutex mutex;
2006-02-02 16:55:44 +01:00
int sock;
};
#endif // _HLSWSERVER_H_