• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UDP support for NSStream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UDP support for NSStream


  • Subject: Re: UDP support for NSStream
  • From: Liwei <email@hidden>
  • Date: Sun, 3 Aug 2008 23:45:17 +0000

Well, both will work really since its not some big network I have, but
multicast will be better.

So what do I use as the destination address? The multicast address
(like 255.255.0.0)? Would that work?

2008/8/3 Jens Alfke <email@hidden>:
>
> On 3 Aug '08, at 10:45 AM, Liwei wrote:
>
>> Hmm, I can't seem to find information about how I may listen to and
>> make a broadcast over UDP. It seems that it needs to be connected in
>> some way first. How do I configure a connectionless UDP socket?
>
> I've done this, but it was years ago and I don't have access to the source
> code anymore. :-(
>
> IIRC, you create the CFSocket, using the right protocol constants for UDP,
> but don't connect it to a destination address. Then every time you want to
> send a packet, you call CFSocketSendData, with the 'address' parameter set
> to the address you want to send that packet to. You'll need to open another
> CFSocket for listening for incoming packets.
>
> Do you mean "broadcast" literally? Instead of using UDP broadcast, which is
> deprecated, you should use multicast with an address in the link-local
> multicast range. (IIRC, the reason is that a UDP broadcast will be received
> by every single machine on the subnet, while a multicast can be ignored by
> machines that aren't listening on that particular multicast address.) Modern
> services like Bonjour use multicast.
>
> —Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: UDP support for NSStream
      • From: Mark Pauley <email@hidden>
References: 
 >UDP support for NSStream (From: Liwei <email@hidden>)
 >Re: UDP support for NSStream (From: Jens Alfke <email@hidden>)
 >Re: UDP support for NSStream (From: Liwei <email@hidden>)
 >Re: UDP support for NSStream (From: Jens Alfke <email@hidden>)

  • Prev by Date: Jabber libraries suitable for Cocoa apps?
  • Next by Date: Re: Jabber libraries suitable for Cocoa apps?
  • Previous by thread: Re: UDP support for NSStream
  • Next by thread: Re: UDP support for NSStream
  • Index(es):
    • Date
    • Thread