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

Explicit TCP/UDP socket binding, local port retrieval. #47398

Merged

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Mar 26, 2021

Work on salvaging #43174 .

In this PR:

  • Allow explicit bind of sockets used by PacketPeerUDP and StreamPeerTCP.
  • Add get_local_port to TCP/UDP classes to retrieve local port.
  • Rename PacketPeerUDP.listen to PacketPeerUDP.bind to make it consistent with TCP, and separate the concept of client/server (abstracted by UDPServer) and socket binding.

@Faless Faless added this to the 4.0 milestone Mar 26, 2021
@Faless Faless changed the title [WIP] Explicit TCP/UDP socket binding, local port retrieval. [WIP] [salvage] Explicit TCP/UDP socket binding, local port retrieval. Mar 26, 2021
@Faless Faless force-pushed the feature/network-local-port-salvaged branch from 2cc2a47 to 2589711 Compare April 12, 2021 15:18
@Faless Faless marked this pull request as ready for review April 12, 2021 15:19
@Faless Faless requested review from a team as code owners April 12, 2021 15:19
@Faless
Copy link
Collaborator Author

Faless commented Apr 12, 2021

Should be good to go when CI passes.

@Faless Faless changed the title [WIP] [salvage] Explicit TCP/UDP socket binding, local port retrieval. [salvage] Explicit TCP/UDP socket binding, local port retrieval. Apr 12, 2021
core/io/packet_peer_udp.cpp Outdated Show resolved Hide resolved
core/io/packet_peer_udp.cpp Outdated Show resolved Hide resolved
core/io/stream_peer_tcp.cpp Show resolved Hide resolved
core/io/tcp_server.cpp Outdated Show resolved Hide resolved
doc/classes/StreamPeerTCP.xml Outdated Show resolved Hide resolved
doc/classes/StreamPeerTCP.xml Outdated Show resolved Hide resolved
doc/classes/PacketPeerUDP.xml Outdated Show resolved Hide resolved
core/io/udp_server.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga changed the title [salvage] Explicit TCP/UDP socket binding, local port retrieval. Explicit TCP/UDP socket binding, local port retrieval. Apr 12, 2021
@Faless Faless force-pushed the feature/network-local-port-salvaged branch 2 times, most recently from 43ee337 to bbd153a Compare April 12, 2021 19:04
@Faless Faless force-pushed the feature/network-local-port-salvaged branch from bbd153a to 4d5c8e0 Compare April 12, 2021 19:05
@Faless Faless requested a review from Calinou April 12, 2021 19:07
@Faless
Copy link
Collaborator Author

Faless commented Apr 12, 2021

Thanks for the review! Addressed the issues.
Changed the error message to consistently reference either local or remote port (trying to make explicit the reason when 0 is allowed).

@akien-mga akien-mga merged commit 72bd64c into godotengine:master Apr 27, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants