This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
Sharing SSLClient between MQTT and HTTP? #20
Answered
by
khoih-prog
marcelstoer
asked this question in
Q&A
-
Do I need a separate Simplified code EthernetClient client;
EthernetSSLClient sslClient(client, TAs, (size_t)TAs_NUM);
PubSubClient mqttClient(MQTT_SERVER, MQTT_PORT, pubSubCallback, sslClient);
// connect to MQTT broker, subscribe to topic in setup()
// feed the mqttClient in loop()
// after new message received through pubSubCallback()
// call sslClient.connect(host, port) to load some resources from an HTTP server
// -> fails with "Arduino client is already connected?" The error is raised from https://github.com/khoih-prog/EthernetWebServer_SSL/blob/main/src/SSLClient/SSLClient_Impl.h#L65. Does it really mean I need two |
Beta Was this translation helpful? Give feedback.
Answered by
khoih-prog
Apr 3, 2022
Replies: 1 comment 2 replies
-
I suggest to use multiple instances to avoid future issues. Check similar issue Cannot send requests to different addresses #4, solved by using multiple Client instances. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
marcelstoer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest to use multiple instances to avoid future issues.
Check similar issue Cannot send requests to different addresses #4, solved by using multiple Client instances.