Re: UDP broadcast

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Frank,

You want to set the EnableBroadcast property on the UdpClient instance
set to true. Once you do that, you want to send your request to the IP
address of 255.255.255.255. From the documentation for the EnableBroadcast
property on the UdpClient class:
Broadcasting is limited to a specific subnet. You can broadcast to your
local subnet by sending a packet to 255.255.255.255; or, you can use the
directed broadcast address, which is the network portion of an Internet
Protocol (IP) address with all bits set in the host portion. For example, if
your IP address is 192.168.1.40 (a Class C address, with the network portion
as the first three octets, and the host portion is the last octet), your
directed broadcast address is 192.168.1.255.

Hope this helps.




--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx





"Frank Esser" <Mistral@xxxxxxxxxxxxxx> wrote in message
news:efYG2%23ObFHA.3144@xxxxxxxxxxxxxxxxxxxxxxx
> Hello!
>
> I have got machines that answer a certain UDP broadcast request with
> certain information about them.
>
> Some years ago I wrote a VB6 application that just sent out this UDP
> broadcast request and received all machine information to display all
> available machines in a grid.
>
> Now I want to write the same application in C# but so far with no success.
>
> There is a udp client available in the .NET framework but how can I use it
> for my purpose?
>
> I think it must be a matter of not more than 10 lines of code but I did
> not find a hint so far how to do it... Can anybody help?
>
> Thanks!
>


.



Relevant Pages

  • troubleshooting help
    ... I am trying to figure out why my mpd server won't ... PACKET: REGISTRATION; REQUEST; BROADCAST ... PACKET: QUERY; REQUEST; BROADCAST ...
    (freebsd-questions)
  • Re: ShareFS Windows client?
    ... be a useful project to resurrect. ... I forget the ports but it uses basically two - one to broadcast on to ... Any interaction had an identifier and a protocol ... Sent request for file. ...
    (comp.sys.acorn.apps)
  • Re: Broadcast IP question
    ... local machine sends out an form of request it is basically a broadcast ... machine) some form of response, and what one of the testers was ... being sent across the network and said device would notice the request. ...
    (microsoft.public.windows.server.setup)
  • Broadcasting an SNMP GET - idSNMP?
    ... I need to broadcast an SNMP GET request onto the local subnet, ... The idSNMP component has a BroadcastEnabled property, and I can send the GET ...
    (alt.comp.lang.borland-delphi)