完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想建立一个UDP服务器(在PIC32 MZ上),多个大(~8KB)缓冲区至少4x/s。可以有5个客户端读取多播数据报。我使用的是和声V2.05,XC1.44。我已经搜索了和声“帮助”文件,还有UDP和IGMP的部分,这表明这是可以做到的。但是,没有示例程序或代码片段显示如何做到这一点。我发现了一个旧的论坛线程,建议使用UDP(这是在IGMP添加到和声之前)。在该线程中,@ Runad建议查看MNS模块,但我找不到一个MNS模块,DNS模块没有提及多播。从HTTP//www. McCHIP.COM/FUMMS/M88401.ASPX(2015年5月7日),TCP/IP栈中没有IGMP支持(允许)加入/离开等。使用UDP来结束和接收多播消息是相当简单的。作为一个例子,您可以在这样做的MNS模块中查看一下。例如,您可以这样做:静态UppSosichAppSkt=无效ID套接字;//应用程序SoCostatic静态Car AppIPv4ReMeST(20)=“224.0.0.251”;//IPv4;多播地址静态UDPX端口AppRealPoT=5353;//IPv4远程PotoStutuDPixPotoCalPalt=5353;//IPv4客户端本地PosiStudio BoOL UDPyMcASTASOPEN(空隙){IPa多地址AppEnter地址;TCPPIpHelPielStrugtoIP地址(AppIPv4ReMead,and AppMealth.V4Add);AppSkt= TCPIpU-UdpclicliopPooporn(IpAdAddiSsSype IPv4,AppExpRead,AppLimeAdvor);If(AppStt==SimuldIdSocket){返回false;} TCPIpU.UppBIN(AppSKT,IpAddiSrSype Type IPv4,Apple CalPoT,0);返回true;}在调用UdpMcAsTestOPEN()之后,可以使用常规套接字函数到TX和Rx:TCPPIpUDPU-PUTISEADE,TCPIPSUDPYARADYPUT,TC,TCPIPUDUPFLUSCHPTPIPUDPGGETSIGREST,TCPPIPUDPARARYGETSO,我有2个问题:1。我应该使用UDP还是IGMP?2。我如何使用和谐API来做推荐的操作呢?
以上来自于百度翻译 以下为原文 I would like to setup a UDP server (on a PIC32MZ) that multicasts a large (~8KB) buffer at least 4x/sec. There can be <5 clients that read the multicast datagrams. I am using HARMony v2.05, XC1.44. I have searched the Harmony "help" files and there are sections on UDP and IGMP that suggest this can be done. However, there are no example programs or code snippets showing how to do this. I did find an old forum thread that suggests using UDP (this was before IGMP was added to Harmony). In that thread, @rainad suggests looking at the mDNS module, but I cannot find an mDNS module and the DNS module does not mention multicasting. So, I have 2 questions:from http://www.microchip.com/forums/m858401.aspx (May 7, 2015) 1. Should I use UDP or IGMP? 2. How do I use the Harmony APIs to do whichever is recommended? |
|
相关推荐
2个回答
|
|
IGMP已经被添加到TCP/IP栈中,这是首选的方法。1。我应该使用UDP还是IGMP?-两者兼而有之。IGMP函数作为UDP套接字的一个参数。注意,有一个特殊的UDP套接字选项用于多播:UPDPopOutlook组播。请注意:IGMP协议与路由器通信,并通知他们关于主机沿着链路处理多个来源的组播业务的愿望。否则,路由器可能会删除多播流量,如果它不知道任何收件人。那么,如果使用远程多播服务器,则需要IGMP。如果在局域网中做一些简单的传输,则不需要IGMP。2。我如何使用和谐API来做推荐的操作呢?-实现的IGMP是V3。然而,有一些简单的API模仿V2用法(连接和离开):TCPIpIIIMPMPION和TCPPIPSIGMPOLY离开。您可以使用这些功能,您对处理V3标准提供的订阅列表不感兴趣。一旦您调用了“联接”,就只需使用UDP套接字,这样您就可以正常地接收和发送数据。
以上来自于百度翻译 以下为原文 The IGMP has been added to the TCP/IP stack and it's the preferred approach. 1. Should I use UDP or IGMP? - Both. IGMP functions take as an argument UDP sockets. Note that there is a special UDP socket option for multicast: UDP_OPTION_MULTICAST. You may want to use it. Note: IGMP protocol communicates with the routers and informs them about the desire of the hosts along the chain to process multicast traffic from certain sources. Otherwise the router might drop the multicast traffic, if it doesn't know of any recipients. So, if you use a remote multicast server, then you need IGMP. If you do some simple transfers within your LAN, no IGMP is required. 2. How do I use the Harmony APIs to do whichever is recommended? - The implemented IGMP is v3. However there are simple APIs that mimic the v2 usage (join and leave): TCPIP_IGMP_Join and TCPIP_IGMP_Leave. You can use these functions of you are not interested in handling subscribe lists offered by v3 standard. Once you called Join, then just use the UDP socket as you would normally do to receive and send the data. |
|
|
|
你提到的线程表明它是按照Runad的建议工作的。我在搜索和声目录和查找MNS方面没有问题。也许DON2愿意在书中分享一个价格/份额。
以上来自于百度翻译 以下为原文 The thread you mention indicates it was made to work following the rainad suggestions. I have no problems searching the Harmony directories and finding mDns as mentioned. Maybe Don2 would be willing to share for a price/share in the book proceeds. [edit:] rainad beat me to a response.... |
|
|
|
只有小组成员才能发言,加入小组>>
5158 浏览 9 评论
1997 浏览 8 评论
1926 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3169 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2222 浏览 5 评论
723浏览 1评论
606浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
494浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
620浏览 0评论
519浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 15:35 , Processed in 1.178518 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号