mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-17 18:29:19 +01:00
43 lines
846 B
C++
43 lines
846 B
C++
#pragma once
|
|
|
|
#include "utils/BackgroundThreadWrapper.hpp"
|
|
#include "utils/logger.h"
|
|
#include <coreinit/cache.h>
|
|
|
|
#define PORT 21
|
|
|
|
class BackgroundThread : BackgroundThreadWrapper {
|
|
public:
|
|
static BackgroundThread *getInstance() {
|
|
if (instance == nullptr) {
|
|
instance = new BackgroundThread();
|
|
DCFlushRange(&instance, 4);
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
static void destroyInstance() {
|
|
if (instance != nullptr) {
|
|
delete instance;
|
|
instance = nullptr;
|
|
DCFlushRange(&instance, 4);
|
|
}
|
|
}
|
|
|
|
BackgroundThread();
|
|
|
|
~BackgroundThread() override;
|
|
|
|
private:
|
|
static int32_t getPriority() {
|
|
return 16;
|
|
}
|
|
|
|
BOOL whileLoop() override;
|
|
|
|
static BackgroundThread *instance;
|
|
|
|
int serverSocket = -1;
|
|
int network_down = 0;
|
|
};
|