[OT] Re: [iPhone] networking-is it crippled on the simulator?
[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