first re-commit.
This commit is contained in:
66
libMiniCash/mcreceiver.h
Normal file
66
libMiniCash/mcreceiver.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************
|
||||
|
||||
miniCashConnect
|
||||
Copyright © 2022 christoph holzheuer
|
||||
c.holzheuer@sourceworx.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef MCRECEIVER_H
|
||||
#define MCRECEIVER_H
|
||||
|
||||
#include <QTcpServer>
|
||||
#include <QWidget>
|
||||
|
||||
#include <libMiniCash.h>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Ein angespasster QTcpServer
|
||||
*/
|
||||
|
||||
class LIBMINICASH_EXPORT MCReceiver : public QTcpServer
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit MCReceiver() = default;
|
||||
virtual ~MCReceiver();
|
||||
|
||||
void setupConnection( int port );
|
||||
|
||||
public slots:
|
||||
|
||||
void onCreateConnection();
|
||||
void onDiscardConnection();
|
||||
|
||||
signals:
|
||||
|
||||
void connectionChanged( miniCash::CState newState );
|
||||
void newTransaction( QString data );
|
||||
|
||||
protected slots:
|
||||
|
||||
void onNewConnection();
|
||||
void onReadReady();
|
||||
void onSocketDisconnected();
|
||||
|
||||
protected:
|
||||
|
||||
void appendToSocketList(QTcpSocket* socket);
|
||||
|
||||
int _port = -1;
|
||||
QSet<QTcpSocket*> _connections;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // MCRECEIVER_H
|
Reference in New Issue
Block a user