forked from LaloLoop/TFTPApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tftpserver.h
executable file
·42 lines (29 loc) · 1.07 KB
/
tftpserver.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
#ifndef TFTPSERVER_H
#define TFTPSERVER_H
#include <QString>
#include "tftpcommon.h"
#include "socketmonitor.h"
#include "listener.h"
#include "senderworker.h"
#include "writerworker.h"
class TFTPServer : public TFTPCommon{
SocketUDP * sockServer;
InetSockAddr * serverAddr;
QString *currentDir;
Listener * cListener; // Detectar nuevos clientes.
SenderWorker *sWorker; // Atiende peticiones de lectura.
WriterWorker *wWorker; // Atiende peticiones de escritura.
bool running;
public:
explicit TFTPServer(QObject * parent = 0);
TFTPServer(QString ip, qint16 port, QObject *parent = 0);
~TFTPServer();
void start(); // Inicia el servidor.
void stop(); // Detiene el servidor.
bool isRunning(); // Is running?
void setRunning(bool);
public slots:
void atenderCliente(rqCode, QString, qint16, QString fileName, QString mode); // Atender la petición del cliente.
void clienteAtendido(rqCode);
};
#endif // TFTPSERVER_H