what to do when i run the matlab coding it show "configuremulticast" is supported only on "windows in the command window
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2021-1-21
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!