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

StreamPeerTCP get_status() not returning correctly #74033

Closed
7hedubz opened this issue Feb 27, 2023 · 2 comments
Closed

StreamPeerTCP get_status() not returning correctly #74033

7hedubz opened this issue Feb 27, 2023 · 2 comments

Comments

@7hedubz
Copy link

7hedubz commented Feb 27, 2023

Godot version

4.0 RC5 & 3.5.1
EDIT - Upon further testing this result is in all current Release Candidates, 1-5

System information

WIN 10

Issue description

When connecting to an external TCP Socket (in a python script) the get_status() function returns the integer 1 for [all 4.0 RC's]

and properly returns 2 in 3.5.1.

The python script properly returns f"Connection from {addr} accepted" in both instances

Steps to reproduce

Run the Python script, Run Godot with script attached to main scene.

All code is the same for all versions of Godot. Python being ran on 3.11.0 but should be almost exactly the same with all versions 3.0+

Minimal reproduction project

zzz.zip

@fengjiongmax
Copy link

This is due to a change of behavior in the function StreamPeerTCP::get_status(), in version 3.5, when calling the function, the engine will check the status of the socket, and then call poll it if it's in STATUS_CONNECTING , and in version 4.0, status check was removed.
So you can try call poll() on the StreamPeerTCP object before getting the status so it's updated.
4.0 StreamPeerTCP::get_status
3.5 StreamPeerTCP::get_status

It was changed in PR #59582

@7hedubz
Copy link
Author

7hedubz commented Mar 28, 2023

Will get around to properly checking that and marking issue as resolved shortly, I appreciate the look that you've had at this for me.

Correctly fixed issue, I appreciate the assistance with this.

@7hedubz 7hedubz closed this as completed Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants