-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Implemented getsockname and poll #41600
Conversation
Can you explain some possible use cases for this feature? |
I used for STUN NAT behavior discovery in my multiplayer implementation. |
@MmAaXx500 Is this still desired? If so, you should open a proposal, and this needs to be rebased and tested on the latest master branch. While there are no conflicts, rebasing is important so that reviewers can easily test the PR. A proposal is also needed so that we can better evaluate what the use cases are for this feature. |
I will put this into a draft until #48195 is resolved. |
getsockname in NetSocket and EnetSocket poll in EnetSocket
Updated the timeout handling according to #48203. |
@@ -63,6 +63,7 @@ class NetSocket : public Reference { | |||
virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port, bool p_peek = false) = 0; | |||
virtual Error send(const uint8_t *p_buffer, int p_len, int &r_sent) = 0; | |||
virtual Error sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IP_Address p_ip, uint16_t p_port) = 0; | |||
virtual Error getsockname(IP_Address &r_ip, uint16_t &r_port) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should likely be get_socket_name
. Other methods here are not snake_case, but that's a separate problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in godot.cpp too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this name would need to be changed in many places if it's changed on this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The godot.cpp is a separate class and is in the thirdparty folder, that's why I asked.
Ok, I'll modify it tomorrow (it's late at night here).
Then this pr is useless, right? |
I think the only unimplemented bit there is |
Is it desirable? If so, I'll do my best in a separate pr. BTW2: Some hours ago I discovered the fact that I'm currently not using the |
Implemented
getsocknme
in NetSocket and ENetSocket andpoll
in ENetSocketThis closes: godotengine/godot-proposals#2587