mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-07 01:13:50 +02:00
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
* Removed Q3Socket dependency from the vGuest switcher driver.
This commit is contained in:
parent
ca949a8001
commit
15cd9954a0
@ -19639,3 +19639,5 @@
|
||||
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed Q3Socket dependency from the Broadcast Tools MLR>>Web
|
||||
switcher driver.
|
||||
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed Q3Socket dependency from the vGuest switcher driver.
|
||||
|
@ -1,8 +1,8 @@
|
||||
// rdsocket.cpp
|
||||
//
|
||||
// A QSocket object with connection-ID.
|
||||
// A QTcpSocket object with connection-ID.
|
||||
//
|
||||
// (C) Copyright 2002,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -21,22 +21,22 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <qwidget.h>
|
||||
#include <q3socket.h>
|
||||
|
||||
#include <rdsocket.h>
|
||||
#include "rdsocket.h"
|
||||
|
||||
RDSocket::RDSocket(int id,QObject *parent)
|
||||
: Q3Socket(parent)
|
||||
: QTcpSocket(parent)
|
||||
{
|
||||
id_num=id;
|
||||
connect(this,SIGNAL(hostFound()),this,SLOT(hostFoundData()));
|
||||
connect(this,SIGNAL(connected()),this,SLOT(connectedData()));
|
||||
connect(this,SIGNAL(connectionClosed()),this,SLOT(connectionClosedData()));
|
||||
connect(this,SIGNAL(disconnected()),this,SLOT(connectionClosedData()));
|
||||
connect(this,SIGNAL(delayedCloseFinished()),
|
||||
this,SLOT(delayedCloseFinishedData()));
|
||||
connect(this,SIGNAL(readyRead()),this,SLOT(readyReadData()));
|
||||
connect(this,SIGNAL(bytesWritten(int)),this,SLOT(bytesWrittenData(int)));
|
||||
connect(this,SIGNAL(error(int)),this,SLOT(errorData(int)));
|
||||
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),
|
||||
this,SLOT(errorData(QAbstractSocket::SocketError)));
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ void RDSocket::bytesWrittenData(int nbytes)
|
||||
}
|
||||
|
||||
|
||||
void RDSocket::errorData(int error)
|
||||
void RDSocket::errorData(QAbstractSocket::SocketError error)
|
||||
{
|
||||
emit errorID(error,id_num);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A QSocket object with connection-ID.
|
||||
//
|
||||
// (C) Copyright 2002,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -22,9 +22,9 @@
|
||||
#define RDSOCKET_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <q3socket.h>
|
||||
#include <qtcpsocket.h>
|
||||
|
||||
class RDSocket : public Q3Socket
|
||||
class RDSocket : public QTcpSocket
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -37,7 +37,7 @@ class RDSocket : public Q3Socket
|
||||
void delayedCloseFinishedID(int id);
|
||||
void readyReadID(int id);
|
||||
void bytesWrittenID(int nbytes,int id);
|
||||
void errorID(int error,int id);
|
||||
void errorID(QAbstractSocket::SocketError error,int id);
|
||||
|
||||
private slots:
|
||||
void hostFoundData();
|
||||
@ -46,7 +46,7 @@ class RDSocket : public Q3Socket
|
||||
void delayedCloseFinishedData();
|
||||
void readyReadData();
|
||||
void bytesWrittenData(int nbytes);
|
||||
void errorData(int error);
|
||||
void errorData(QAbstractSocket::SocketError error);
|
||||
|
||||
private:
|
||||
int id_num;
|
||||
|
@ -248,8 +248,9 @@ VGuest::VGuest(RDMatrix *matrix,QObject *parent)
|
||||
this,SLOT(connectionClosedData(int)));
|
||||
connect(vguest_socket[i],SIGNAL(readyReadID(int)),
|
||||
this,SLOT(readyReadData(int)));
|
||||
connect(vguest_socket[i],SIGNAL(errorID(int,int)),
|
||||
this,SLOT(errorData(int,int)));
|
||||
connect(vguest_socket[i],
|
||||
SIGNAL(errorID(QAbstractSocket::SocketError,int)),
|
||||
this,SLOT(errorData(QAbstractSocket::SocketError,int)));
|
||||
ipConnect(i);
|
||||
}
|
||||
}
|
||||
@ -533,42 +534,43 @@ void VGuest::readyReadData(int id)
|
||||
}
|
||||
|
||||
|
||||
void VGuest::errorData(int err,int id)
|
||||
void VGuest::errorData(QAbstractSocket::SocketError err,int id)
|
||||
{
|
||||
int interval=VGUEST_RECONNECT_MIN_INTERVAL;
|
||||
|
||||
switch((Q3Socket::Error)err) {
|
||||
case Q3Socket::ErrConnectionRefused:
|
||||
interval=GetHoldoff();
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
switch(err) {
|
||||
case QAbstractSocket::ConnectionRefusedError:
|
||||
interval=GetHoldoff();
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
"connection to vGuest device at %s:%d refused, attempting reconnect",
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
vguest_reconnect_timer[id]->start(interval,true);
|
||||
break;
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
vguest_reconnect_timer[id]->start(interval,true);
|
||||
break;
|
||||
|
||||
case Q3Socket::ErrHostNotFound:
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
case QAbstractSocket::HostNotFoundError:
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error on connection to vGuest device at %s:%d: Host Not Found",
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
break;
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
break;
|
||||
|
||||
case Q3Socket::ErrSocketRead:
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error on connection to vGuest device at %s:%d: Socket Read Error",
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(!vguest_error_notified[id]) {
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error %d on connection to vGuest device at %s:%d: Socket Read Error",
|
||||
err,
|
||||
(const char *)vguest_ipaddress[id].toString().toUtf8(),
|
||||
vguest_ipport[id]);
|
||||
vguest_error_notified[id]=true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -594,7 +596,6 @@ void VGuest::pingData(int id)
|
||||
|
||||
void VGuest::pingResponseData(int id)
|
||||
{
|
||||
vguest_socket[id]->clearPendingData();
|
||||
vguest_socket[id]->close();
|
||||
rda->syslog(LOG_WARNING,"vGuest connection to "+
|
||||
vguest_ipaddress[id].toString()+
|
||||
|
@ -62,7 +62,7 @@ class VGuest : public Switcher
|
||||
void connectedData(int id);
|
||||
void connectionClosedData(int id);
|
||||
void readyReadData(int id);
|
||||
void errorData(int err,int id);
|
||||
void errorData(QAbstractSocket::SocketError err,int id);
|
||||
void gpioOneshotData(int value);
|
||||
void pingData(int id);
|
||||
void pingResponseData(int id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user