HTTP socket connection error

Ritu21
Posts: 34
Joined: Sat Aug 04, 2018 9:58 am

HTTP socket connection error

Postby Ritu21 » Thu Nov 15, 2018 1:05 pm

Hi,

I am using http_client to send UART data to http_server. Data is received & I get the below response.

I (58813) http_client: HTTP POST Status = 201, content_length = -1

But, it happens till 8 times the data is received on UART, after which (i.e. 9th time) I start getting the below error till I reboot the module.

E (64173) TRANS_TCP: Error create socket
E (64173) HTTP_CLIENT: Connection failed, sock < 0
E (64183) http_client: HTTP POST request failed: ESP_ERR_HTTP_CONNECT

Is there any limit to socket creation ?? Please help me to rectify this.

Thanks
R.

Ritu21
Posts: 34
Joined: Sat Aug 04, 2018 9:58 am

Re: HTTP socket connection error

Postby Ritu21 » Fri Nov 16, 2018 4:17 am

Please reply.

linuxpaul
Posts: 37
Joined: Thu Jul 20, 2017 6:10 pm

Re: HTTP socket connection error

Postby linuxpaul » Fri Nov 16, 2018 4:24 pm

Hi,

I'm not very familar with writing code and I'm not sure I got this question.
I don't think that the number of sockets is limited in that number but
I can't get the connection from one UART to the need of multible sockets.

my experience:
I wrote this socket uart bridge:
https://bitbucket.org/linuxpaul/esp32-u ... rc/master/

Multible sockets on a client?
Sometimes there is some trouble with a socket e.g. the connection hat changed.
So I need a close and a reinit. Somtimes the reinit fails because the LAN connection or
wifi has been dropped then I do a wifi reinit. In the result I think there is no more then on open
socket on my Module.

Multible sockets on a Server?
In my opinion this is possible but just multible clients are connected, or?

... but may be I'm totally wrong
:) linuxpaul

User avatar
fly135
Posts: 457
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: HTTP socket connection error

Postby fly135 » Fri Nov 16, 2018 7:40 pm

Ritu21 wrote:
Fri Nov 16, 2018 4:17 am
Please reply.
After reviewing the code you posted I'm going to take a wild guess and say... "You're doing something wrong".

Yes, there is a limit to how many sockets you can have created at the same time. Just like there is a limit to how much memory you can allocate at once.

John A

Ritu21
Posts: 34
Joined: Sat Aug 04, 2018 9:58 am

Re: HTTP socket connection error

Postby Ritu21 » Mon Nov 19, 2018 6:27 am

Hi,

Yes, I was not closing the connection and that's why I was getting the error.

Now I am sorted with that problem.

Thank you for your time.

Regards
R.

Who is online

Users browsing this forum: No registered users and 20 guests