Re: UDP broadcast/receive notification system



On Fri, 18 Jul 2008 12:07:01 -0700, Mark <mmodrall@xxxxxxxxxxxxx> wrote:

[...]
In his classes, he prefaces each broadcast message with a guid so that when
a message comes in he can check to see if it's one he just sent. This
spurred a couple of questions for me:
1) I haven't yet seen a message I drop on the broadcast address come back on
my receiver socket. Was this just speculative overkill on his part?

Are you sure that's all he's using it for? He may be also (or instead) using the GUID to detect duplicated datagrams at the recipient end.

My recollection is that the sending socket won't get echos, so if that's all he's doing, yes...that's probably overkill. But it's possible that's not all he's doing.

2) Now I know this sounds a little daft, but he purposely set it up so that
multiple processes on the same box can both broadcast and receive. Would I
see the message coming from my box on one of the other processes (if I get
one started up) that's listening on the same port?

Unless you bind to different IP addresses, you wouldn't be able to receive on the same port (I prefer not to use the word "listen" when talking about UDP, because it has a more specialized meaning in the context of TCP). You wouldn't be able to create the socket unless you specifically say that you want to reuse the address, and even reusing the address is not necessarily going to allow two different sockets to both receive data on the same port.

But yes, assuming you explicitly bind to two different IP addresses, you could have one process send a datagram, and another process on the same computer receive that datagram.

Pete
.



Relevant Pages

  • Re: System.Net.Sockets.SocketException -UDP
    ... > an deinen Port gesendet werden. ... > Klar muss das der selbe Socket sein. ... > Empfangen in der selben Klasse gruselig? ... UDPs senden als Broadcast an Port 19000 --> klappt ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Linux, IO::Socket::INET and recving broadcasted UDP
    ... destination udp port = 68) but my socket never receives it. ... Can you recieve other broadcast datagrams? ... Have you tried using a PF_PACKET socket? ... receive broadcasts a UDP socket has to be bound to the wildcard ...
    (comp.lang.perl.misc)
  • Re: Problem with connecting udp socket
    ... First I connect my socket to a specified ip and port, ... Any sender with your UDP socket's address and port will be able to send you data. ... If you are trying to send or receive broadcast data, you need to use the broadcast address 255.255.255.255 and set the Broadcast socket option. ... If you are trying to send to a specific endpoint, you need to use a valid and correct endpoint address. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why is one port better than another for streaming video?
    ... >>randomly chosen, free port. ... >>minutes for a 300kb live broadcast to travel a 768kb up connection. ... >the website isn't involved in the data path). ... Well I know the player actually resides on the ...
    (microsoft.public.windowsmedia.encoder)
  • Receiving INADDR_BROADCAST packets
    ... Ok, the broadcast sending problem is solved, as far as I'm concerned. ... Possibly conditionalise this interface based on a socket-level option. ... I'm an interface-bound socket and I'd like undirected ... I already cache the interface index in my internal RIB and track RTM_IFINFO, ...
    (freebsd-net)