【问题标题】:UdpDiscoveryEndpoint with a broadcast address带有广播地址的 UdpDiscoveryEndpoint
【发布时间】:2012-06-17 16:38:15
【问题描述】:

是否可以将 Wcf UdpDiscoveryEndpoint 与广播地址一起使用而不是多播? 我尝试使用广播地址但抛出异常,这是 WcfDiscovery 的限制吗?

这是个例外:

System.Net.Sockets.SocketException (0x80004005): The requested address is not valid in its context
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at System.ServiceModel.Channels.UdpUtility.BindSocket(Socket socket, IPEndPoint localEndpoint)
   at System.ServiceModel.Channels.UdpUtility.CreateListenSocket(IPAddress ipAddress, Int32& port, Int32 receiveBufferSize, Int32 timeToLive, Int32 interfaceIndex, Boolean allowMulticastLoopback, Boolean isLoopbackAdapter)
   at System.ServiceModel.Channels.UdpChannelListener.InitSockets(Boolean updateListenPort)
   at System.ServiceModel.Channels.UdpChannelListener..ctor(IUdpTransportSettings settings, BindingContext context)
   at System.ServiceModel.Channels.UdpTransportBindingElement.BuildChannelListener[TChannel](BindingContext context)
   at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()
   at System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener[TChannel](BindingContext context)
   at System.ServiceModel.Channels.TextMessageEncodingBindingElement.BuildChannelListener[TChannel](BindingContext context)
   at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()
   at System.ServiceModel.Channels.Binding.BuildChannelListener[TChannel](Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters)
   at System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener& result, Boolean supportContextSession)
   at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result)
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnBeginOpen()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open()

【问题讨论】:

    标签: .net wcf c#-4.0 ws-discovery


    【解决方案1】:

    我在客户的服务器上遇到了同样的问题。事实证明,他配置了两个具有重叠子网掩码的网络设备。因此 udpDiscoveryEndpoint 无法开始侦听上述异常。

    【讨论】:

      猜你喜欢
      • 2011-02-28
      • 2014-11-17
      • 1970-01-01
      • 1970-01-01
      • 2011-06-18
      • 2010-10-16
      • 1970-01-01
      • 2014-09-04
      • 2022-07-07
      相关资源
      最近更新 更多