mirror of
				https://github.com/ElvishArtisan/rivendell.git
				synced 2025-11-04 08:04:12 +01:00 
			
		
		
		
	2022-11-29 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SuppressRdcatchMeterUpdates=' directive to '[Hacks]' section of rd.conf(5). * Fixed a regression in the RDCatch subsystem that caused remote deck indication to break. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
		@@ -2,7 +2,7 @@
 | 
			
		||||
//
 | 
			
		||||
// Multi-interface multicast transciever
 | 
			
		||||
//
 | 
			
		||||
//   (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
 | 
			
		||||
//   (C) Copyright 2018-2022 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 
 | 
			
		||||
@@ -25,6 +25,8 @@
 | 
			
		||||
#include <net/if.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#include <QNetworkDatagram>
 | 
			
		||||
 | 
			
		||||
#include "rdmulticaster.h"
 | 
			
		||||
 | 
			
		||||
RDMulticaster::RDMulticaster(QObject *parent)
 | 
			
		||||
@@ -101,18 +103,10 @@ void RDMulticaster::send(const QString &msg,const QHostAddress &m_addr,
 | 
			
		||||
 | 
			
		||||
void RDMulticaster::readyReadData()
 | 
			
		||||
{
 | 
			
		||||
  struct sockaddr_in sa;
 | 
			
		||||
  socklen_t sa_len=sizeof(struct sockaddr_in);
 | 
			
		||||
  char data[1501];
 | 
			
		||||
  int n;
 | 
			
		||||
 | 
			
		||||
  memset(&sa,0,sizeof(sa));
 | 
			
		||||
  while((n=recvfrom(multi_socket->socketDescriptor(),data,1500,MSG_DONTWAIT,
 | 
			
		||||
		    (sockaddr *)&sa,&sa_len))>0) {
 | 
			
		||||
    data[n]=0;
 | 
			
		||||
    QString msg(data);
 | 
			
		||||
    emit received(msg,QHostAddress(ntohl(sa.sin_addr.s_addr)));
 | 
			
		||||
    sa_len=sizeof(struct sockaddr_in);
 | 
			
		||||
  while(multi_socket->hasPendingDatagrams()) {
 | 
			
		||||
    QNetworkDatagram dg=multi_socket->receiveDatagram();
 | 
			
		||||
    printf("emitting: %s",dg.data().constData());
 | 
			
		||||
    emit received(QString::fromUtf8(dg.data()),dg.senderAddress());
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user