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

Move networking classes from panda3d.core into separate panda3d.net #1466

Open
Tracked by #1604
rdb opened this issue Feb 22, 2023 · 2 comments
Open
Tracked by #1604

Move networking classes from panda3d.core into separate panda3d.net #1466

rdb opened this issue Feb 22, 2023 · 2 comments
Labels
discussion Issues opened primarilly to start a discussion enhancement
Milestone

Comments

@rdb
Copy link
Member

rdb commented Feb 22, 2023

It's possible to build Panda without networking code. However, this causes a bunch of classes to go missing from panda3d.core, causing various imports within direct to stop working. It's not at all obvious to figure out which code depends on net classes and which code doesn't.

I think the networking code should be in a separate panda3d.net module so that it's obvious when something relies on net code, and results in less cryptic import errors. This additional modularity would mean that it can be trivially detected whether net code is used and it can be easily removed at deployment if it is not used.

This would unfortunately be a breaking change. But it is a fairly easy one to work around.

I would suggest 1.11 to be a transition release where the classes are defined in both panda3d.net and panda3d.core, and removing them from panda3d.core in the release after that.

For what it's worth, I ran into this when building for web, where the networking code is compiled out entirely (since raw sockets aren't available on the web). In other situations we tend to create stub versions of classes that do nothing but this would be impractical for the networking classes.

@rdb rdb added enhancement discussion Issues opened primarilly to start a discussion labels Feb 22, 2023
@rdb rdb added this to the 1.11.0 milestone Feb 22, 2023
@BMaxV
Copy link
Contributor

BMaxV commented Apr 22, 2023

Good idea, I don't think the code/docs are usable anyway. Is it known whether there are projects that would be affected?

@rdb rdb mentioned this issue Jan 23, 2024
28 tasks
rdb added a commit that referenced this issue Mar 1, 2024
@rdb
Copy link
Member Author

rdb commented Mar 1, 2024

Yes, any projects that use the ConnectionReader/Writer, NetDatagram, socket etc classes will ultimately need to import those from panda3d.net instead of panda3d.core, though not yet in 1.11, possibly 1.12 or 2.0.

If you think the code or docs for the classes inside the net/nativenet directories are unusable, please file separate issues detailing your complaints with them.

@rdb rdb modified the milestones: 1.11.0, 1.12.0 Mar 1, 2024
rdb added a commit to rdb/panda3d that referenced this issue Mar 1, 2024
See panda3d#1466 - these classes are still part of panda3d.core as of 1.11, but they should really be imported from panda3d.net (they can be imported from either place in 1.11).  A future release will remove them from panda3d.core entirely.
rdb added a commit that referenced this issue Mar 2, 2024
See #1466 - these classes are still part of panda3d.core as of 1.11, but they should really be imported from panda3d.net (they can be imported from either place in 1.11).  A future release will remove them from panda3d.core entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issues opened primarilly to start a discussion enhancement
Projects
None yet
Development

No branches or pull requests

2 participants