-
Notifications
You must be signed in to change notification settings - Fork 234
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
Reading REMOTE_IP on UDP socket crashes xsbug (and possibly the whole program) #457
Comments
The way to retrieve the IP address of the remote is different for TCP and UDP sockets. For a TCP socket, the remote IP address never changes during the lifetime of the connection It is available with For a UDP sockets, the remote IP address may be different for each packet received. Therefore, remote IP address is passed as an argument to the callback. The callback arguments for a UDP packet are: callback(message, value, address, port) The remote IP address is in That said, calling |
Oh I see! I indeed failed to check if there were any extra arguments passed to the callback, since the documentation didn't mention any difference for the callback of a UDP socket. I was searching and found this little snippet, so I thought I had found what I needed:
Thank you so much for the quick response, I love the work you are all doing on this project and hope to be able to contribute in the near future ☺ |
Build environment: Windows
Target device: NodeMCU ESP8266
Description
Creating a UDP socket and reading the "REMOTE_IP" of an incoming connection crashes xsbug. It possibly also crashes the whole program, but since the debugger crashes I can't strep through to check it.
Console output:
main.js:
manifest.json:
Python test script:
Steps to Reproduce
Expected behavior
I can read the REMOTE_IP and store it in a variable so I can include it in the Socket.write() method
The text was updated successfully, but these errors were encountered: