what to do when i run the matlab coding it show "configuremulticast" is supported only on "windows in the command window
1 回表示 (過去 30 日間)
古いコメントを表示
NORFAZNEZA NAZLINDA MOHD NORDIN
2021 年 1 月 21 日
回答済み: Walter Roberson
2021 年 1 月 21 日
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!