34 lines
840 B
C
34 lines
840 B
C
|
|
#ifndef DISTRIBUTION_SERVICE_TASK_INFO_H
|
||
|
|
#define DISTRIBUTION_SERVICE_TASK_INFO_H
|
||
|
|
|
||
|
|
#include "CCDatagramSocket.h"
|
||
|
|
#include "CCThreadPool.h"
|
||
|
|
#include "TL/Map.h"
|
||
|
|
#include "PushFlowTask.h"
|
||
|
|
|
||
|
|
class TaskInfo {
|
||
|
|
inline static CTL::Map<int,TaskInfo*> TaskInfoMap;
|
||
|
|
inline static CTL::DatagramSocket* socket = nullptr;
|
||
|
|
inline static std::shared_mutex mutex_socket;
|
||
|
|
public:
|
||
|
|
inline static CTL::ThreadPool thread_pool;
|
||
|
|
TaskInfo();
|
||
|
|
~TaskInfo();
|
||
|
|
void BitstreamHeartbeat();
|
||
|
|
int Flag = 0;
|
||
|
|
int Type = 0;
|
||
|
|
int TaskID = -1;
|
||
|
|
int TaskType = 0;
|
||
|
|
int ServerPort = 10060;
|
||
|
|
CTL::Map<int, int> Terms;
|
||
|
|
PushFlowTask* pushFlowTask = nullptr;
|
||
|
|
private:
|
||
|
|
public:
|
||
|
|
static void InitSocket();
|
||
|
|
static void Start(TaskInfo* taskInfo);
|
||
|
|
static void Stop(int TaskID);
|
||
|
|
static TaskInfo* getData(int TaskID);
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|