Hello,
Edit: I put this in the wrong category. It should be in “Network” rather than “Game Networking” and I realized it as soon as I submitted it.
I am running into an odd issue and I am unsure of how to debug it further. I run identical code on multiple devices:
-
Corona Simulator (Windows)
-
Corona Simulator (Windows)
-
Corona Simulator (Mac)
4-8) 5 iPhones
Here is the code that runs on each of these eight
local url = "http://www.hook-shots.com/app/testConnection.php" local headers = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; headers["Accept-Language"] = "en-US"; local params = {} params.headers = headers params.body = "" network.request(url,"POST",networkListener,params)
And the networkListener() method referenced above:
local function networkListener(event) if event.isError then print("checkConnection isError") self.onlineMode = false elseif string.sub(event.response,1,18) == "CONNECTION\_SUCCESS" then print("checkConnection found CONNECTION\_SUCCESS") end end
On devices 3-8, I have never had any issue with this. It returns CONNECTION_SUCCESS and prints the success string to the console.
Device 1 (Corona Simulator on a Windows machine) worked fine for weeks. Then over the weekend, running the same code, I began receiving event.isError = true and “checkConnection isError” prints to the console.
I was getting a new laptop anyway (Device 2) and it came today. It also receives isError = true and prints the error message.
Devices 3-8 still work without issue.
Without seeing any detail behind this network request, it is hard for me to determine what is going on. What makes it especially strange is that it works, running the same application, from several other devices. Also, Device 1 and Device 2 receive isError for any URL within hook-shots.com. But if you change the url variable to “http://www.google.com” it receives the data back successfully.
The site receiving the error is a site on a GoDaddy shared hosting plan. I tried contacting their support staff about the issue but they were unable to find any issue on their side, as they could connect to the URL successfully from every source they could attempt.
The issue seems to be narrowed down specifically to Corona Simulator and to URLs at this site, but without being able to see the inner workings/details of the network request from either side, I am having trouble debugging this.
Has anyone else run into and/or overcome an issue like this with Corona Simulator and a Web site? Does anyone have any suggestions for what I could try to move past this error?