Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

setReuse feature #12

Closed
rjjrbatarao opened this issue Oct 18, 2022 · 4 comments
Closed

setReuse feature #12

rjjrbatarao opened this issue Oct 18, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@rjjrbatarao
Copy link

This library is great, one problem though when connecting twice on the same host takes a long time, I was wondering if theres a feature you could add to reuse the connection to avoid doing ssl handshake again, this could reduce the request time significantly on second request.

@khoih-prog
Copy link
Owner

Hi @rjjrbatarao

Thanks for your nice words and the enhancement request.

I already found out and fixed the issue, and will release a new version within today. It won't reconnect if already connected, certainly after verifying the same host and port.

Even though your issue is a good one, I almost ignored it because the issue was opened without MRE. Luckily, I changed my mind before pressing the button.

Hopefully you'll do it correctly next time.

Best Regards,

@khoih-prog khoih-prog added the enhancement New feature or request label Oct 18, 2022
@khoih-prog
Copy link
Owner

This is the test debug showing no more connect attempt to the same host:port


Starting AsyncHTTPSRequest_ESP using ESP32_DEV
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
Connecting to WiFi SSID: HueNet1
...
AsyncHTTPSRequest @ IP : 192.168.2.80
[AHTTPS] open: connecting to hostname = worldtimeapi.org:443    <====== New connect attempt
[AHTTPS] _client->connecting to worldtimeapi.org , 443
[AHTTPS] client.connect OK to worldtimeapi.org , 443

**************************************
[AHTTPS] Response Code =  HTTP OK

**************************************
abbreviation: EDT
client_ip: 104.247.247.31
datetime: 2022-10-18T13:10:03.030242-04:00
day_of_week: 2
day_of_year: 291
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1666113003
utc_datetime: 2022-10-18T17:10:03.030242+00:00
utc_offset: -04:00
week_number: 42
**************************************
HH[AHTTPS] open: already connected    <====== No more connect attempt
H
**************************************
[AHTTPS] Response Code =  HTTP OK

**************************************
abbreviation: EDT
client_ip: 104.247.247.31
datetime: 2022-10-18T13:10:31.897109-04:00
day_of_week: 2
day_of_year: 291
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1666113031
utc_datetime: 2022-10-18T17:10:31.897109+00:00
utc_offset: -04:00
week_number: 42

khoih-prog added a commit that referenced this issue Oct 18, 2022
### Releases v2.1.3

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](#12)
khoih-prog added a commit that referenced this issue Oct 18, 2022
### Releases v2.1.3

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](#12)
khoih-prog added a commit that referenced this issue Oct 18, 2022
### Releases v2.1.3

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](#12)
@khoih-prog
Copy link
Owner

Hi @rjjrbatarao

The new AsyncHTTPSRequest_Generic v2.1.3 has just been released. Your contribution is noted in Contributions and Thanks.

Please test and report any more issue or enhancement.

Best Regards,


Releases v2.1.3

  1. Not try to reconnect to the same host:port after connected. Check setReuse feature #12

khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Generic that referenced this issue Oct 19, 2022
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Generic that referenced this issue Oct 19, 2022
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Generic that referenced this issue Oct 19, 2022
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/Portenta_H7_AsyncHTTPRequest that referenced this issue Oct 19, 2022
### Releases v1.3.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/Portenta_H7_AsyncHTTPRequest that referenced this issue Oct 19, 2022
1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Teensy41 that referenced this issue Oct 19, 2022
### Releases v1.8.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Teensy41 that referenced this issue Oct 19, 2022
### Releases v1.8.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Teensy41 that referenced this issue Oct 19, 2022
### Releases v1.8.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_RP2040W that referenced this issue Oct 19, 2022
### Release v1.1.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_RP2040W that referenced this issue Oct 19, 2022
### Release v1.1.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_RP2040W that referenced this issue Oct 19, 2022
### Release v1.1.1

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
@rjjrbatarao
Copy link
Author

Wow thank you very much for the feature your the Man!, I'll definitely will follow the MRE next time, I'll test it with my current code and report how it goes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants