title: List all devices' IP Addresses on wifi network iOS sdk without bonjour?
body: <p>I am trying to get a list of all IP's on a LAN network. The reason for this is I am writing an application that uses the STAR TSP100LAN receipt printer.</p>
  
  <p>The process for obtaining the IP address of the printer is quite cumbersome for the end user. It involves turning the printer off, holding the paper feed button, turning the printer back on, waiting 15 seconds for the printer to obtain an IP address through DHCP and then finally spitting out a receipt with this information on it.</p>
  
  <p>Seeing as the printer is not Bonjour enabled is it possible to get the IP address through other methods?</p>
  
  <p>Any help is much appreciated! I hope this isn't a repeat question, but through my searching I can't seem to find a solution!</p>
  
  <p><strong>UPDATE</strong>: Ok after a bit of thinking I have come up with a pseudo-solution:</p>
  
  <ol>
  <li><p>Determine the iPad's current IPAddress through NSHost.</p></li>
  <li><p>Strip the last quadrant from the IPAddress</p></li>
  <li><p>Using the stripped string as a prefix, iterate 1-255 for the last quadrant</p></li>
  <li>Each iteration, attempt to open a port to the given address using the printer's sdk
  If I get a valid response, I know that the IP is a printer
  If not I exclude the IP from the available printers list.</li>
  </ol>
  
  <p>So far this has been working, I set a timeout of 5 milleseconds for each port open attempt. But have found that this can return some null results despite there actually being a printer on the network with an IP Address assigned.</p>
  
  <p>Perhaps if I get a null result the first time I should increase the timeout to 15 milleseconds for a second attempt at searching.</p>