Im getting ERROR: null W/System.err(20560): java.io.EOFException from a network.request

    local body = "userId=31"     local params = {}     params.body = body network.request( "server/someifle.php", "POST", networkRequestListener, params)

everything work fine, but at some random moments, I get an error in the networkListenerRequests.

If you read this post on stack overflow, http://stackoverflow.com/questions/13182519/spring-rest-template-usage-causes-eofexception

they mention something about an attribute keep alive. Can this be set in corona or does anyone know anything else I can do?

The error message:

E/Corona  (20560): ERROR: null

W/System.err(20560): java.io.EOFException

W/System.err(20560):    at libcore.io.Streams.readAsciiLine(Streams.java:203)

W/System.err(20560):    at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:579)

W/System.err(20560):    at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:827)

W/System.err(20560):    at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)

W/System.err(20560):    at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)

W/System.err(20560):    at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1394)

W/System.err(20560):    at java.lang.Thread.run(Thread.java:841)

Just for completion, before Engineering can look at this, can you also post your networkListenerRequests function?

Also, did you just type the code in?  Your network.request() call is missing a quote.  Do you know much about the server in question?  What software is it running?  Apache, IIS? Tomcat?  What version of PHP?  Are you in control of the web server?

Rob

Just a typo, missed the first quote, fixed it now.

Listener:

local function networkRequestListener(event)     if ( event.isError ) then         print( "Network error!")         return     end     print("response error:", event.response) end

We are using GAE (Google App Engine), it seem to be PHP version 5.4 with default settings.

I really do not know what to answer to if we are in control of the server, I assume that we can set some of the settings by our own.

Just for completion, before Engineering can look at this, can you also post your networkListenerRequests function?

Also, did you just type the code in?  Your network.request() call is missing a quote.  Do you know much about the server in question?  What software is it running?  Apache, IIS? Tomcat?  What version of PHP?  Are you in control of the web server?

Rob

Just a typo, missed the first quote, fixed it now.

Listener:

local function networkRequestListener(event)     if ( event.isError ) then         print( "Network error!")         return     end     print("response error:", event.response) end

We are using GAE (Google App Engine), it seem to be PHP version 5.4 with default settings.

I really do not know what to answer to if we are in control of the server, I assume that we can set some of the settings by our own.

Did you find a solution?

I am now seeing this as well on an app that I just updated. I am using the same Corona Enterprise that I used on the build before, so I don’t think it is a Corona issue.

One of the updates was that I changed my backend server from  ASP(IIS) to PHP, maybe it is something related to that?  I also change my http payload response from a JSON type to a base64 data…

I followed the link posted by @kruseborn and was able to solve the problem.

I just had to add a header to force close the connection on the response from my php server.

So, I just added to my PHP page:

header("Connection: close");

and the problem was solved!

Thanks for the link @kruseborn

Did you find a solution?

I am now seeing this as well on an app that I just updated. I am using the same Corona Enterprise that I used on the build before, so I don’t think it is a Corona issue.

One of the updates was that I changed my backend server from  ASP(IIS) to PHP, maybe it is something related to that?  I also change my http payload response from a JSON type to a base64 data…

I followed the link posted by @kruseborn and was able to solve the problem.

I just had to add a header to force close the connection on the response from my php server.

So, I just added to my PHP page:

header("Connection: close");

and the problem was solved!

Thanks for the link @kruseborn