EOFException after server responds

2019-09-13 21:08发布

问题:

I have a quite simple problem but I've still couldn't find a solution yet.

What I want to accomplish:

I'm trying to establish a reliable connection between a smartphone running Android and the ESP8266 wifi module. I would like to send short HTTP string messages, where the phone plays the role of a client and the ESP8266 of a server. For managing HTTP requests I'm using the Volley library.

What already works:

I am able to do a successful HTTP GET request to the ESP8266 from a browser running on the Android phone. I also managed to use Volley to make a GET request to a server running on the web.

What doesn't work:

On the other hand, I cannot successfully send a GET request to ESP8266 using Volley. To be more precise, I get an EOFException when the server (ESP8266) tries to close the connection after it has responded. When using a browser the body of the response gets displayed after the connection is closed but in case of Volley the connection closing fails and shuts down the server.

I have no idea how to solve this problem/bug. What frustrates me is that the same commands for sending a HTTP response on the ESP work well when using a web browser but fail when using Volley. So I guess the problem is something about Volley.

Any ideas why Volley throws such exception? Any help would be deeply appreciated.