-
Notifications
You must be signed in to change notification settings - Fork 0
/
filetransferreceiver.cpp.autosave
50 lines (41 loc) · 1.23 KB
/
filetransferreceiver.cpp.autosave
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
50
#include "filetransferreceiver.h"
#include <QDebug>
#include <QHostAddress>
FileTransferReceiver::FileTransferReceiver(QObject *parent) :
QTcpSocket(parent)
{
qDebug() << "Receiver was started";
connect(this,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(this,SIGNAL(connected()),this,SLOT(connected()));
connect(this,SIGNAL(hostFound()),this,SLOT(hostFound()));
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(error(QAbstractSocket::SocketError)));
connect(this,SIGNAL(disconnected()),this,SLOT(disconnect()));
}
void FileTransferReceiver::readyRead()
{
qDebug() << "There a bytes to read yay";
}
void FileTransferReceiver::connected()
{
QHostAddress ip = this->peerAddress();
qDebug() << "Sender(" << ip.toString() << ") can now send the file";
}
void FileTransferReceiver::disconnect()
{
qDebug() << "The sender has closed the connection";
}
qint64 FileTransferReceiver::readData(char *data, qint64 maxlen)
{
return 0;
}
qint64 FileTransferReceiver::writeData(const char *data, qint64 len)
{
return 0;
}
void FileTransferReceiver::hostFound()
{
qDebug() << "Just found an host (sender)";
}
void FileTransferReceiver::error(QAbstractSocket::SocketError error)
{
}