Possible to identify which interface connected via socket configuration? #18018
Closed
Jibun-no-Kage
started this conversation in
General
Replies: 2 comments
-
Hello |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the suggestion... I have not as yet looked at async approach. But I did find away to figure out the interface, or IP Address at least, by parsing the request string, parsing out the 'host' value. Not perfect but at least functional to as which interface was used. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Possible to identify which interface connected via socket configuration? I have an ESP32 which happens to have both WiFi and Ethernet (via W5500) support. I am opening a socket with '0.0.0.0' as the target address. But this seems to have a side effect that since I am listening to all interfaces, both WiFi and Ethernet, I don't see an obvious way to determine which interface the client used to connect to the ESP32. is there a way to programmatically determine this? Below the code I am using to open socket, accept connection.
Opening two sockets, running them on different threads, or cores, etc. seems overly complex, just to know which IP address the client happen to connect to.
Beta Was this translation helpful? Give feedback.
All reactions