Re: UDP broadcast
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Jun 2005 11:17:25 -0400
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!
>
.
- Follow-Ups:
- Re: UDP broadcast
- From: Frank Esser
- Re: UDP broadcast
- References:
- UDP broadcast
- From: Frank Esser
- UDP broadcast
- Prev by Date: Re: Button click event
- Next by Date: Wandering Controls - control location changes in designer
- Previous by thread: UDP broadcast
- Next by thread: Re: UDP broadcast
- Index(es):
Relevant Pages
|