what to do when i run the matlab coding it show "configuremulticast" is supported only on "windows in the command window
1 view (last 30 days)
Show older comments
NORFAZNEZA NAZLINDA MOHD NORDIN
on 21 Jan 2021
Answered: Walter Roberson
on 21 Jan 2021
clc;
clear all;
uSender = udpport()
uReceiver1 = udpport("datagram", "LocalPort", 3030, "EnablePortSharing", true)
uReceiver2 = udpport("LocalPort", 3030, "EnablePortSharing", true)
configureMulticast(uReceiver1, "226.0.0.1");
configureMulticast(uReceiver2, "226.0.0.1");
uReceiver1.MulticastGroup
uReceiver1.EnableMulticast
uReceiver2.MulticastGroup
uReceiver2.EnableMulticast
write(uSender,"Hello world! Together we fight #covid-19!","string","226.0.0.1",3030);
uReceiver1Count = uReceiver1.NumDatagramsAvailable
uReceiver2Count = uReceiver2.NumBytesAvailable
data1 = read(uReceiver1,uReceiver1Count,"string");
data1.Data
data2 = read(uReceiver2,uReceiver2Count,"string")
configureMulticast(uReceiver1, "off");
configureMulticast(uReceiver2, "off");
clear uReceiver1;
clear uReceiver2;
clear uSender;
0 Comments
Accepted Answer
Walter Roberson
on 21 Jan 2021
you are correct that new function is only available for windows.
https://www.mathworks.com/help/instrument/udpport.configuremulticast.html
but see https://www.mathworks.com/matlabcentral/answers/56534-does-matlab-support-udp-multicast#answer_239823
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!