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

Add missing function getSocketOption #7807

Merged
merged 9 commits into from
Nov 29, 2023
Merged

Conversation

rtpmsys
Copy link
Contributor

@rtpmsys rtpmsys commented Feb 6, 2023

There is a function for setting socket options (setSocketOption) but the corresponding function to read the socket options is missing.
This PR provides the missing function getSocketOption.

Tests scenarios

Tested this on ESP32 with the following code:

WiFiClient client;
int rcvbuf_size = 0;
client.getSocketOption(SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, sizeof(int));

The int rcvbuf_size will contain the receive buffer size of the socket.

This is the second part of #7361 (now closed) which was split into PR #7686 (merged) and this one

@mrengineer7777
Copy link
Collaborator

mrengineer7777 commented Feb 7, 2023

Oops. LWIP getsockopt(). Edit: Expected parameters may have changed.

In file included from /home/runner/Arduino/hardware/espressif/esp32/libraries/WiFi/src/WiFiClient.cpp:22:
/home/runner/Arduino/hardware/espressif/esp32/tools/sdk/esp32c3/include/lwip/lwip/src/include/lwip/sockets.h:635:81: note:   initializing argument 5 of 'int getsockopt(int, int, int, void*, socklen_t*)'
 static inline int getsockopt(int s,int level,int optname,void *opval,socklen_t *optlen)

@CLAassistant
Copy link

CLAassistant commented May 6, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ me-no-dev
❌ rtpmsys
You have signed the CLA already but the status is still pending? Let us recheck it.

@VojtechBartoska VojtechBartoska added the Area: WiFi Issue related to WiFi label Nov 28, 2023
@VojtechBartoska VojtechBartoska added this to the 3.0.0-RC1 milestone Nov 28, 2023
@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Nov 28, 2023
@me-no-dev me-no-dev merged commit e99437c into espressif:master Nov 29, 2023
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: WiFi Issue related to WiFi Status: Review needed Issue or PR is awaiting review
Projects
Development

Successfully merging this pull request may close these issues.

5 participants