Repository navigation
XGameRuntime: XNetworking change registrations fire the initial callback - #1237
Open
emirduran707 wants to merge 1 commit into
Open
emirduran707 wants to merge 1 commit into
emirduran707 wants to merge 1 commit into
Conversation
XNetworkingRegisterConnectivityHintChanged and XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged only handed out a token and never called the title's callback. The GDK docs say the first "registers a "connectivity hint changed" notification and sends an initial notification callback", and that registering for the second "always fires an initial notification callback". A title that waits for that callback (for instance to see networkInitialized) waited forever. Both now queue one callback on the queue's completion port, as XUserRegisterForDeviceAssociationChanged does: the current hint (from XNetworkingGetConnectivityHint) or DEFAULT_UDP_PORT. The record is freed when the queue refuses it, and a canceled callback only frees it. The callback is `_In_` in both signatures, so a null one is E_INVALIDARG, like the XUser registration. register_fires_an_initial_callback fails without this change (callback count 0 after registering on an Immediate/Immediate queue). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XNetworkingRegisterConnectivityHintChangedandXNetworkingRegisterPreferredLocalUdpMultiplayerPortChangedhanded out a token and never called the callback. Microsoft's documentation says both send a first callback when they register: the connectivity one "registers a "connectivity hint changed" notification and sends an initial notification callback", and the port one "always fires an initial notification callback". The network-initialization guidance builds on that: a title registers and then waits for the callback to reportnetworkInitialized. Under XCL such a title waited forever, or treated the network as not up.Both now write the token, then queue one callback on the queue's completion port through
xasync::submit_callback, asnotify_associationdoes for user-association changes. The connectivity callback carries the current hint fromXNetworkingGetConnectivityHint, and the port callback carriesDEFAULT_UDP_PORT. A null callback isE_INVALIDARG, as forXUserRegisterForDeviceAssociationChanged. If the queue refuses the callback, its record is freed and a warning is logged.What is in it
crates/xcl/src/hle/xgameruntime/networking.rs: the first callbacks; testregister_fires_an_initial_callback. It uses an immediate queue and checks that each callback runs once, withnetwork_initializedtrue and port 3074, and that a null callback is refused.Tested
cargo test --workspace -- --test-threads=4on e2a4b1d: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsleft: 0,right: 1; with it it passesRegression run
main:
this PR:
Not tested
XCL_NETWORK=0level (it comes fromXNetworkingGetConnectivityHint); not run together.AI use
🤖 Generated with Claude Code