mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 22:43:11 +02:00
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
* Removed Q3Socket dependency from the Software Authority switcher driver.
This commit is contained in:
parent
f45bd74bb4
commit
31661dab8a
@ -19623,3 +19623,6 @@
|
||||
driver.
|
||||
* Removed Q3Socket dependency from the WheatNet LIO switcher
|
||||
driver.
|
||||
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed Q3Socket dependency from the Software Authority switcher
|
||||
driver.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Rivendell switcher driver for systems using Software Authority Protocol
|
||||
//
|
||||
// (C) Copyright 2002-2019 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 General Public License version 2 as
|
||||
@ -61,13 +61,14 @@ SoftwareAuthority::SoftwareAuthority(RDMatrix *matrix,QObject *parent)
|
||||
//
|
||||
// Initialize the connection
|
||||
//
|
||||
swa_socket=new Q3Socket(this);
|
||||
swa_socket=new QTcpSocket(this);
|
||||
connect(swa_socket,SIGNAL(connected()),this,SLOT(connectedData()));
|
||||
connect(swa_socket,SIGNAL(connectionClosed()),
|
||||
this,SLOT(connectionClosedData()));
|
||||
connect(swa_socket,SIGNAL(readyRead()),
|
||||
this,SLOT(readyReadData()));
|
||||
connect(swa_socket,SIGNAL(error(int)),this,SLOT(errorData(int)));
|
||||
connect(swa_socket,SIGNAL(error(QAbstractSocket::SocketError)),
|
||||
this,SLOT(errorData(QAbstractSocket::SocketError)));
|
||||
ipConnect();
|
||||
}
|
||||
|
||||
@ -203,30 +204,31 @@ void SoftwareAuthority::readyReadData()
|
||||
}
|
||||
|
||||
|
||||
void SoftwareAuthority::errorData(int err)
|
||||
void SoftwareAuthority::errorData(QAbstractSocket::SocketError err)
|
||||
{
|
||||
switch((Q3Socket::Error)err) {
|
||||
case Q3Socket::ErrConnectionRefused:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"connection to SoftwareAuthority device at %s:%d refused, attempting reconnect",
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
swa_reconnect_timer->start(SWAUTHORITY_RECONNECT_INTERVAL,true);
|
||||
break;
|
||||
switch(err) {
|
||||
case QAbstractSocket::ConnectionRefusedError:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"connection to SoftwareAuthority device at %s:%d refused, attempting reconnect",
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
swa_reconnect_timer->start(SWAUTHORITY_RECONNECT_INTERVAL,true);
|
||||
break;
|
||||
|
||||
case Q3Socket::ErrHostNotFound:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error on connection to SoftwareAuthority device at %s:%d: Host Not Found",
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
break;
|
||||
case QAbstractSocket::HostNotFoundError:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error on connection to SoftwareAuthority device at %s:%d: Host Not Found",
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
break;
|
||||
|
||||
case Q3Socket::ErrSocketRead:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error on connection to SoftwareAuthority device at %s:%d: Socket Read Error",
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
break;
|
||||
default:
|
||||
rda->syslog(LOG_WARNING,
|
||||
"error %d on connection to SoftwareAuthority device at %s:%d",
|
||||
err,
|
||||
(const char *)swa_ipaddress.toString().toUtf8(),
|
||||
swa_ipport);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Rivendell switcher driver for systems using Software Authority Protocol
|
||||
//
|
||||
// (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 General Public License version 2 as
|
||||
@ -24,8 +24,8 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <q3socket.h>
|
||||
#include <qhostaddress.h>
|
||||
#include <qtcpsocket.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <rd.h>
|
||||
@ -54,7 +54,7 @@ class SoftwareAuthority : public Switcher
|
||||
void connectedData();
|
||||
void connectionClosedData();
|
||||
void readyReadData();
|
||||
void errorData(int err);
|
||||
void errorData(QAbstractSocket::SocketError err);
|
||||
|
||||
private:
|
||||
void SendCommand(const char *str);
|
||||
@ -62,7 +62,7 @@ class SoftwareAuthority : public Switcher
|
||||
void ExecuteMacroCart(unsigned cartnum);
|
||||
QString PrettifyCommand(const char *cmd) const;
|
||||
QString BundleString(int offset,bool state);
|
||||
Q3Socket *swa_socket;
|
||||
QTcpSocket *swa_socket;
|
||||
char swa_buffer[SWAUTHORITY_MAX_LENGTH];
|
||||
unsigned swa_ptr;
|
||||
QHostAddress swa_ipaddress;
|
||||
|
Loading…
x
Reference in New Issue
Block a user