New LuaSocket Example Added To API (How to retrive device IP Address & Port)

Hey guys.

I have added an example code to the API listing that demonstrates how to retrive the device IP and Port using Lua Sockets. The code works on both simulator and device.

You can see the example here :

http://developer.anscamobile.com/reference/index/network

I will be adding more Lua Socket examples and updating the Api to make it more informative as time permits.

Thanks! [import]uid: 84637 topic_id: 16306 reply_id: 316306[/import]

Cool. An example of how to send an email with an attached image using Lua Sockets would be appreciated. [import]uid: 1560 topic_id: 16306 reply_id: 60761[/import]

How can I send bytes instead of Strings with LuaSocket? [import]uid: 152929 topic_id: 16306 reply_id: 109264[/import]

Since most of the world lives behind a NAT firewall and live on 192.168.*.* or 10.0.0.* addresses, does this return the local non-routable IP address, or does it return the network facing NAT IP address?

I’m suspecting it returns the non-routable address.

While I’m not needing this information anytime soon, the difference is important depending on your application. For instance if you’re writing an FTP client (non-passive) mode that needs to have the server open port back to your machine you would need the routable NAT address (or the DMZ address that you can setup with some routers). But if you’re trying to do a LAN game with people on the same wireless hub as you, then you would want the non-routable address since it’s the visible address on the local network…

I miss my socket programming days…
[import]uid: 19626 topic_id: 16306 reply_id: 109282[/import]