Network Module support ?

Hey everyone,

I was going to start implementing some networking features but I didn’t see in the supported modules the network.* . There is support for sockets and the ltn12, but they are synchronous functions and I need asynchronous requests.

I know that you can use this one to build a custom module to implement async features, but before starting to code it, I’d like to know if there will there be support for asynchronous network requests soon.

We do plan on adding async network support in the future, but I can’t promise that we’ll deliver it this month.  We have a few other tasks that we want to accomplish first.  We do recognize that this is a popular feature, but I don’t want to block your app development waiting for it, because I can’t give you a solid date on it yet.

But that said, if you choose to do this for yourself, I’ll be more than happy to point you in the right direction on how to set up the Native/Lua bridge for this and which C# classes you should be using.

Hey Joshua,

Sorry for the late reply.

We will probably wait for the Corona implementation then (seems a bit of a waste to code something that will be replaced soon). Do you have an ETA for this feature yet ?

I’m actually ahead of schedule.  I expect to have async network request/download/upload support sometime next week.

Thanks for the quick reply (and with good news too)!

I’m sorry to say this, but async networking is not going to make it this week.  This feature is mostly finished, but we need more time to polish it and handle all of the little details and edge cases.  We should be able to deliver this feature end of next week.  Sorry about the delay.

We’ve sent out a new version that now supports the Lua “network” library.

I’d be interested to know how well it works for you.

Hey Joshua,

I got the build earlier today and am starting to do some tests with it. So far it seems to be working like on other platforms, which is great. I’ll post here if I find any issue with it.

One question, regarding the release notes. It says that the HTTP response is not converted to UTF-8, my guess is this will impact mostly if I’m expecting special chars in the response, since what I’m seeingso far seems to be the same response I get on other platforms ?

On other platforms, Corona will automatically convert the HTTP response body/content to UTF-8 when providing the response string to Lua via a “networkRequest” event.  Corona will only do this if you’re *not* downloading to file… and only if the response is text and not binary.  Most web servers will provide their HTTP response text in UTF-8 form, making this a non-issue for you, but some will respond with a different encoding.  Web servers will indicate what the string encoding is via the “Content-Type” response header, which provides a “charset” setting.

So, this is just something we cut a corner on to save time since we think this is a niche feature.  This allowed us to deliver our networking feature to you and everyone else faster.  However, if you think this will be an issue for you, then please let us know.  We don’t want to block you from porting your apps to WP8.  Plus, it’ll help us prioritize what we should be working on next.

We do plan on adding async network support in the future, but I can’t promise that we’ll deliver it this month.  We have a few other tasks that we want to accomplish first.  We do recognize that this is a popular feature, but I don’t want to block your app development waiting for it, because I can’t give you a solid date on it yet.

But that said, if you choose to do this for yourself, I’ll be more than happy to point you in the right direction on how to set up the Native/Lua bridge for this and which C# classes you should be using.

Hey Joshua,

Sorry for the late reply.

We will probably wait for the Corona implementation then (seems a bit of a waste to code something that will be replaced soon). Do you have an ETA for this feature yet ?

I’m actually ahead of schedule.  I expect to have async network request/download/upload support sometime next week.

Thanks for the quick reply (and with good news too)!

I’m sorry to say this, but async networking is not going to make it this week.  This feature is mostly finished, but we need more time to polish it and handle all of the little details and edge cases.  We should be able to deliver this feature end of next week.  Sorry about the delay.

We’ve sent out a new version that now supports the Lua “network” library.

I’d be interested to know how well it works for you.

Hey Joshua,

I got the build earlier today and am starting to do some tests with it. So far it seems to be working like on other platforms, which is great. I’ll post here if I find any issue with it.

One question, regarding the release notes. It says that the HTTP response is not converted to UTF-8, my guess is this will impact mostly if I’m expecting special chars in the response, since what I’m seeingso far seems to be the same response I get on other platforms ?

On other platforms, Corona will automatically convert the HTTP response body/content to UTF-8 when providing the response string to Lua via a “networkRequest” event.  Corona will only do this if you’re *not* downloading to file… and only if the response is text and not binary.  Most web servers will provide their HTTP response text in UTF-8 form, making this a non-issue for you, but some will respond with a different encoding.  Web servers will indicate what the string encoding is via the “Content-Type” response header, which provides a “charset” setting.

So, this is just something we cut a corner on to save time since we think this is a niche feature.  This allowed us to deliver our networking feature to you and everyone else faster.  However, if you think this will be an issue for you, then please let us know.  We don’t want to block you from porting your apps to WP8.  Plus, it’ll help us prioritize what we should be working on next.