How to listen on multiple IP addresses?

后端 未结 6 1205
别那么骄傲
别那么骄傲 2021-02-15 16:15

If my server has multiple IP addresses assigned to it, and I would like to listen to some (or all) of them, how do I go about doing that?

Do I need to create a new socke

6条回答
  •  醉酒成梦
    2021-02-15 16:59

    Yes, IPAddress.Any will listen on all interfaces.

    http://msdn.microsoft.com/en-us/library/system.net.ipaddress.any.aspx

提交回复
热议问题