homebrew_launcher/src/menu/TcpReceiver.h

41 lines
844 B
C
Raw Normal View History

2016-02-29 22:28:18 +01:00
#ifndef TCP_RECEIVER_H_
#define TCP_RECEIVER_H_
#include <vector>
#include <string>
#include "ProgressWindow.h"
#include "system/CThread.h"
#include "gui/sigslot.h"
class TcpReceiver : public GuiFrame, public CThread {
2016-02-29 22:28:18 +01:00
public:
enum eLoadResults {
2016-02-29 22:28:18 +01:00
SUCCESS = 0,
INVALID_INPUT = -1,
FILE_OPEN_FAILURE = -2,
FILE_READ_ERROR = -3,
NOT_ENOUGH_MEMORY = -4,
FILE_SAVE_ERROR = -5,
2016-02-29 22:28:18 +01:00
};
2016-11-12 15:09:26 +01:00
TcpReceiver(int port);
2016-02-29 22:28:18 +01:00
~TcpReceiver();
sigslot::signal2<GuiElement *, uint32_t> serverReceiveStart;
sigslot::signal3<GuiElement *, uint32_t, int> serverReceiveFinished;
2016-02-29 22:28:18 +01:00
private:
void executeThread();
int loadToMemory(int32_t clientSocket, uint32_t ipAddress);
2016-02-29 22:28:18 +01:00
bool exitRequested;
int32_t serverPort;
int32_t serverSocket;
2016-02-29 22:28:18 +01:00
ProgressWindow progressWindow;
};
#endif