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.
HTTP socket connection error
Re: HTTP socket connection error
Please reply.
Re: HTTP socket connection error
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
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
Re: HTTP socket connection error
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
Re: HTTP socket connection error
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.
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.
Re: HTTP socket connection error
@Ritu21
I am having identical problem as yours.
Could you inform me how did you solve this problem in details?
thanks.
I am having identical problem as yours.
Could you inform me how did you solve this problem in details?
thanks.
Re: HTTP socket connection error
Hi Keesus,
Sorry for my delay in response.
You should always close the connection after sending data to the server by using below api's.
esp_http_client_close(client);
esp_http_client_cleanup(client);
Let me know if you get rid of this problem with the solution..
Thanks
R.
Sorry for my delay in response.
You should always close the connection after sending data to the server by using below api's.
esp_http_client_close(client);
esp_http_client_cleanup(client);
Let me know if you get rid of this problem with the solution..
Thanks
R.
Re: HTTP socket connection error
in my case closing and recreate the socket works.
something like
something like
Code: Select all
close(clientSock)
...
clientSock = accept(sock, (struct sockaddr *)&clientAddress, &clientAddressLength);
Re: HTTP socket connection error
Your query is related to TCP and this is related to HTTP.
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 99 guests