24 lines
520 B
C
24 lines
520 B
C
|
|
#ifndef THREADEDSERVERCONNECTION_H
|
||
|
|
#define THREADEDSERVERCONNECTION_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QThread>
|
||
|
|
#include <QTcpSocket>
|
||
|
|
#include <QDataStream>
|
||
|
|
class ThreadedServerConnection : public QThread
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit ThreadedServerConnection(int socketDescriptor, const QString &fortune, QObject *parent=0);
|
||
|
|
void run();
|
||
|
|
signals:
|
||
|
|
void error(QTcpSocket::SocketError socketError);
|
||
|
|
private:
|
||
|
|
int socketDescriptor;
|
||
|
|
QString text;
|
||
|
|
public slots:
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // THREADEDSERVERCONNECTION_H
|