title: SSDP on the iPhone
body: <p>I need to be able to send out a UDP message and also receive one in order to discover SSDP devices on the network from the iPhone.</p>
  
  <p>I know that I need to send the packet to the multicast address and my HTTP request needs to look something like this:</p>
  
  <pre><code>M-SEARCH * HTTP/1.1
  Host: 239.255.255.250:1900
  Man: ssdp:discover
  Mx: 3
  ST: "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
  </code></pre>
  
  <p>From reading the docs it appears that I can do all this with CFNetwork and despite reading (and re-reading the docs) I am struggling to get started.  Can anyone recommend and tutorials or code snippets to get me over the initial learning hump?</p>
  
  <p>I've got the CFNetwork programming guide:</p>
  
  <p><a href="http://developer.apple.com/mac/library/documentation/Networking/Conceptual/CFNetwork/CFNetwork.pdf" rel="noreferrer">http://developer.apple.com/mac/library/documentation/Networking/Conceptual/CFNetwork/CFNetwork.pdf</a></p>
  
  <p>and Beej's Guide to Network programming Using Internet Sockets:</p>
  
  <p><a href="http://beej.us/guide/bgnet/" rel="noreferrer">http://beej.us/guide/bgnet/</a></p>
  
  <p>Thanks</p>
  
  <p>Dave</p>
  
  <p>P.S.</p>
  
  <p>I am unable to use any of the 3rd party libraries and frameworks in this instance.</p>