Sbob
Posts: 3
Joined: Sun Feb 14, 2016 6:50 pm

Problem with HTTP GET

Sun Feb 14, 2016 6:58 pm

Hi,

I'm trying a simple program to perform a few HTTP GET and print the answer.

I connect to my home wifi, create a socket, register some simple callback functions (including printing the data on receive), start the socket and send an HTTP GET.

The first GET works perfectly, and I receive the expected page.

After this, two unexpected things happen:

1. The socket is disconnected
2. If I try to restart it again, it gives and error. If I try to create a new socket, and repeat all the above procedure, the callback functions are not registered.

Can somebody help me?

Thanks in advance.

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: Problem with HTTP GET

Wed Feb 17, 2016 7:44 pm

Sbob wrote:... The socket is disconnected ...

It is expected behaviour. Most http 1.1 servers have short keep-alive timeout (Apache 2.2 - 5 sec) and the client is disconnected after the timeout.

In a few days I'll upload the new version of my WiFiMCU LUA with much improved net module and you'll be able to reuse the same socket after the disconnect. The full http client/server module will be available soon.

Sbob
Posts: 3
Joined: Sun Feb 14, 2016 6:50 pm

Re: Problem with HTTP GET

Thu Feb 18, 2016 7:23 am

Thank you very much!

Sbob
Posts: 3
Joined: Sun Feb 14, 2016 6:50 pm

Re: Problem with HTTP GET

Thu Feb 18, 2016 9:59 pm

Thank you!

I'm looking forward for the new code!


Return to “WiFiMCU”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest