指定哪些网络接口的UDP组播应该转到.NET [英] Specifying what network interface an UDP multicast should go to in .NET

查看:259
本文介绍了指定哪些网络接口的UDP组播应该转到.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在计算机与活性无线网卡和一个LAN端口与挂接到另一台机器上运行相同的应用程序交叉线,我们需要发送一个UDP多播通过LAN线连接到另一台计算机。使用C#套接字时,Windows似乎每一次尝试将消息路由在无线局域网适配器。

On a computer with both an active Wireless Card and a LAN-Port with a crossover cable hooked up to another machine running the same application, we need to send a UDP multicast over the LAN wire to the other computer. Using C# Sockets, Windows seems to try to route the message over the WLAN adapter every time.

有没有一种方法来指定哪些网络接口来发送一个UDP组播功能?

Is there a way to specify what network interface to send a UDP multicast on?

推荐答案

您可能正在寻找 SocketOptionName.MulticastInterface 这里的MSDN上的一篇文章,可能会帮助您。

You are probably looking for SocketOptionName.MulticastInterface. Here's an article on MSDN that might help you.

其他然后如果你更新你的本地路由表中有匹配的多播地址,并指向右侧的接口它应该只是工作的具体条目。

Other then that if you update your local routing table to have an exact entry matching the multicast address and pointing to the right interface it should just work.

这篇关于指定哪些网络接口的UDP组播应该转到.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆