qlcplus icon indicating copy to clipboard operation
qlcplus copied to clipboard

plugins/artnet: force IPv4 when binding UDP socket

Open Pac72 opened this issue 1 year ago • 4 comments
trafficstars

qlcplus on Ubuntu 22.04 right now when configuring ArtNet input on an IPv4 address seems not to receive UDP packets (see #1588). Forcing IPv4 when binding UDP socket solves the issue.

Another more complicated approach is to create a socket for each input address and bind it explicitly to the address

Pac72 avatar Jun 22 '24 14:06 Pac72

Still to be checked, since qlcplus 4.13.1 on Windows 11 and qlcplus 4.12.7 on Mac seem to work out of the box.

Pac72 avatar Jun 23 '24 11:06 Pac72

@Pac72 thanks for this but I'm afraid it won't work.

image

The first argument as SpecialAddress has been introduced in Qt 6.2. QLC+ still needs to be compatible with Qt 5.15 for a while.

mcallegari avatar Jun 24 '24 06:06 mcallegari

Coverage Status

coverage: 32.034%. remained the same when pulling fee6d22278f6de43acd9527dcc1a5f108640dd03 on Pac72:art-net-force-ipv4 into c1f5846de11931e43213afbd49b7cbac1031e23d on mcallegari:master.

coveralls avatar Jun 24 '24 06:06 coveralls

@mcallegari I was puzzled, since I built against 5.15.2 and, as you say, the bind(QHostAddress::SpecialAddress addr,...) is not defined. Then I realized that there is a constructor

QHostAddress(SpecialAddress address)

so the call

udpSocket->bind(QHostAddress::SpecialAddress::AnyIPv4, ARTNET_PORT, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint)

is using

bool bind(const QHostAddress &address, quint16 port = 0, BindMode mode = DefaultForPlatform);

Anyway, this patch is not relevant anymore, since, until now, I haven't been able to reproduce the issue #1588 I opened. Either it was some network sillyness (likely) or some strange linking issue (unlikely).

I'm giving it a last try, then I'll close the issue as PEBKAC.

Pac72 avatar Jun 29 '24 20:06 Pac72