Skip to content

Conversation

@warsang
Copy link

@warsang warsang commented Feb 14, 2025

This is related to #160 and just shows an example/toy implementation for research purposes. Unfortunately, this example doesn't work (and I'm not sure why) so please do not merge it. I mostly wanted to take a shot at supporting channels but not being super familiar with Netfox code, I wasn't able to pull it off. I still wanted to share the work to at least give an idea of what work would be required to get channel support for Netfox.

By default, Godot uses 3 channels for each transfer mode. The below ChannelManager is a bit naive, it should probably keep 1 channel per node instead of assigning one per rpc function meaning we call NetworkTime._channel_manager.get_channel() only once per node and assign that channel to all RPCs in the node. I think that approach would probably work better with unreliable/unreliable_ordered transfer modes?

We implement a channelManager that is instantiated in NetworkTime. -> (Is that the right place to instantiate this? ) When the ChannelManager is enabled, we call rpc_config instead of @rpc decorators for rpc functions because the channel argument in the decorator needs to be a constexpr. The reason we do that is because you apparently can't call a method in @rpc . The get_channel method assigns a channel to the method from a pool of available channels. We could subscribe to network events to assign/free channels in the pool if we get new synchronizer nodes or some are removed (peer disconnects etc.) ;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant