Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketWrapper - copyable networking clients #768

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy commented Nov 21, 2023

copyable networking clients

it is done the same way as in other LwIP based Arduino networking libraries including the C33 LwipWrapper. There WiFiClient/EthernetClient is a simple copyable class redirecting every method to the object managing the socket. That object is stored in std:shared_ptr.
The PR uses the existing MbedClient as the managing class and adds the copyable class from which then WiFiClent and EthernetClient inherit.

I can't test WiFiSSLSE050Client

@megacct
Copy link

megacct commented Nov 22, 2023

Great work, I'm back up and running with my telnet server. I did get a crash when doing a client available() or read() (not sure which) after having called a stop() on the client. Easy workaround in my code and probably shouldn't have been doing that anyway.

@JAndrassy
Copy link
Contributor Author

@facchinm this is important. the networking libraries in this core will not work correctly without this. the copy ability of instanced objects is a feature of the Arduino language. Imagine String would not be copyable in some Core.

@pennam pennam self-assigned this Jan 31, 2024
@pennam
Copy link
Contributor

pennam commented Jan 31, 2024

@JAndrassy I think you should rebase this on master since setTimeout has been renamed in setSocketTimeout

@JAndrassy
Copy link
Contributor Author

@pennam thank you for the reminder. done

Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @JAndrassy

Do you mind also changing setEccSlot visibility? It must be public.

I'm running a bit of testing on this PR so we can hopefully merge it for the next release.

libraries/SE05X/src/WiFiSSLSE050Client.h Show resolved Hide resolved
Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks

@pennam pennam merged commit 4b3327e into arduino:main Feb 5, 2024
11 checks passed
@JAndrassy JAndrassy deleted the copyable_clients branch February 5, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants