• 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
[OT] Re: [iPhone] networking-is it crippled on the simulator?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Re: [iPhone] networking-is it crippled on the simulator?


  • Subject: [OT] Re: [iPhone] networking-is it crippled on the simulator?
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 4 Aug 2009 16:14:17 +0100

On 4 Aug 2009, at 13:43, James Lin wrote:

I've tried two seperate ways of opening up a "server" socket.
1. is by opening up a CFSocket
2. is by a socket wrapper class called LXSocket class obtained from google codes.


but i've so far failed to obtain the "ip address" of the server socket.

You have *bound* the socket, right? If you don't bind it, it won't have an address.


In the CFSocket() API, that means you have to call CFSocketSetAddress ()...

Note also that if you're expecting a given machine (iPhone included) to have "an address" you're being naïve. Machines can have multiple interfaces, each of which can have multiple addresses. You either need to pick one somehow or bind your socket for all interfaces (using e.g. INADDR_ANY).

BTW, this is off-topic for cocoa-dev, since it isn't related to Cocoa. If, after looking at CFSocketSetAddress(), you can't work out what to do, you might consider posting to one of the other mailing lists here:

  <http://lists.apple.com/mailman/listinfo>

or visiting the new Developer Forums site:

  <https://devforums.apple.com/>

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >[iPhone] networking-is it crippled on the simulator? (From: James Lin <email@hidden>)

  • Prev by Date: Re: How refresh window title -- SOLVED
  • Next by Date: Re: [iPhone] networking-is it crippled on the simulator?
  • Previous by thread: Re: [iPhone] networking-is it crippled on the simulator?
  • Next by thread: Re: [iPhone] networking-is it crippled on the simulator?
  • Index(es):
    • Date
    • Thread