Rivendellaudio/cae/connection.h
Fred Gleason 6bcd445650 2023-09-20 Fred Gleason <fredg@paravelsystems.com>
* Removed definition of CAED_TCP_PORT from 'lib/rd.h'.
	* Added definition of RD_CAED_PORT to 'lib/rd.h'.
	* Added definition of RD_CAED_TIMEOUT_INTERVAL to 'lib/rd.h'.
	* Fixed a bug in caed(8) that broke metering CAE commands.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
2023-09-20 12:56:17 -04:00

64 lines
1.5 KiB
C++

// connection.h
//
// UDP connection context for CAE protocol commands
//
// (C) Copyright 2023 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef CONNECTION_H
#define CONNECTION_H
#include <stdint.h>
#include <QHostAddress>
#include <QObject>
#include <QTimer>
#include "session.h"
class Connection : public QObject
{
Q_OBJECT;
public:
Connection(const SessionId &sid,QObject *parent);
~Connection();
SessionId sessionId() const;
uint16_t meterPort() const;
void setMeterPort(uint16_t udp_port);
QString dump() const;
bool operator!=(const Connection &other) const;
bool operator<(const Connection &other) const;
signals:
void connectionExpired(const SessionId &sid);
public slots:
void setTimeout(int msecs);
void touch();
private slots:
void timerData();
private:
SessionId d_session_id;
uint16_t d_meter_port;
QTimer *d_timer;
int d_interval;
};
#endif // SESSION_H