Skip to content

Commit

Permalink
Fix multicast not working
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-spataru committed Oct 25, 2021
1 parent 9f97f5d commit 2c01109
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions assets/qml/Panes/SetupPanes/Network.qml
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ Control {
text: qsTr("Local port") + ":"
enabled: !Cpp_IO_Manager.connected
Behavior on opacity {NumberAnimation{}}
visible: Cpp_IO_Network.socketTypeIndex === 1 && !udpMulticastEnabled
visible: Cpp_IO_Network.socketTypeIndex === 1
} TextField {
id: _udpLocalPort
Layout.fillWidth: true
placeholderText: Cpp_IO_Network.defaultUdpLocalPort
placeholderText: qsTr("Type 0 for automatic port")
Component.onCompleted: text = Cpp_IO_Network.udpLocalPort
onTextChanged: {
if (Cpp_IO_Network.udpLocalPort !== text && text.length > 0)
Expand All @@ -195,7 +195,7 @@ Control {

opacity: enabled ? 1 : 0.5
enabled: !Cpp_IO_Manager.connected
visible: Cpp_IO_Network.socketTypeIndex === 1 && !udpMulticastEnabled
visible: Cpp_IO_Network.socketTypeIndex === 1

Behavior on opacity {NumberAnimation{}}
}
Expand All @@ -208,7 +208,7 @@ Control {
text: qsTr("Remote port") + ":"
enabled: !Cpp_IO_Manager.connected
Behavior on opacity {NumberAnimation{}}
visible: Cpp_IO_Network.socketTypeIndex === 1
visible: Cpp_IO_Network.socketTypeIndex === 1 && !udpMulticastEnabled
} TextField {
id: _udpRemotePort
Layout.fillWidth: true
Expand All @@ -229,7 +229,7 @@ Control {

opacity: enabled ? 1 : 0.5
enabled: !Cpp_IO_Manager.connected
visible: Cpp_IO_Network.socketTypeIndex === 1
visible: Cpp_IO_Network.socketTypeIndex === 1 && !udpMulticastEnabled

Behavior on opacity {NumberAnimation{}}
}
Expand Down
4 changes: 0 additions & 4 deletions src/IO/DataSources/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ QIODevice *Network::openNetworkPort()
m_udpSocket.joinMulticastGroup(address);
}

// Set socket options
m_udpSocket.setSocketOption(QAbstractSocket::LowDelayOption, 1);
m_udpSocket.setSocketOption(QAbstractSocket::MulticastLoopbackOption, 0);

// Update socket pointer
socket = &m_udpSocket;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IO/DataSources/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class Network : public QObject

static QString defaultAddress() { return "127.0.0.1"; }
static quint16 defaultTcpPort() { return 23; }
static quint16 defaultUdpLocalPort() { return 0; }
static quint16 defaultUdpRemotePort() { return 53; }
static quint16 defaultUdpLocalPort() { return 8888; }

QIODevice *openNetworkPort();

Expand Down

0 comments on commit 2c01109

Please sign in to comment.