-
Notifications
You must be signed in to change notification settings - Fork 0
/
filetransferservice.h
49 lines (33 loc) · 1.03 KB
/
filetransferservice.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef FILETRANSFERSERVICE_H
#define FILETRANSFERSERVICE_H
#include <QTcpServer>
#include <QNetworkInterface>
#include <string>
using namespace std;
/**
* @brief The FileTransferService class enables file transfers via the Wifi Channel
*/
class FileTransferService: public QTcpServer
{
public:
/**
* @brief FileTransferService constructor of the service which creates a TCP Server
* @param parent of the service
* @param filePath The path to the file to be shared
* @param ipAddress The IP address for sharing the file
* @param port The port used for listening
*/
FileTransferService(QObject *parent, string filePath, QHostAddress ipAddress, quint16 port);
/**
* @brief ~FileTransferService destructor of the service that closes the TCP server
*/
~FileTransferService();
private:
// The port for listening
int port;
// The file path
string filePath;
// The IP address for sharing the file
QHostAddress ipAddress;
};
#endif // FILETRANSFERSERVICE_H