-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.h
More file actions
30 lines (25 loc) · 794 Bytes
/
Engine.h
File metadata and controls
30 lines (25 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <string>
class TCPListener;
class TCPStream;
class FileManager;
class FileWatcher;
class Packet;
class Engine
{
public:
static Engine* engine;
TCPListener* tCPListener;
TCPStream* tCPStream;
FileWatcher* fileWatcher;
FileManager* fileManager;
bool running;
Engine(std::string path, int port);
Engine(std::string syncPath, int port, std::string address);
~Engine();
void loop();
static void escapeHandler(int s); //catches terminal control-c to handle closing sockets cleanly
void sendEntireFolder(TCPStream* stream);
void sendPacket(Packet* p); //used to bridge listener and stream
void sendPacket(Packet* p, TCPStream* stream); //if server will ignore stream
Packet* getPacket();
};