godot: [Mono] Networking not working with 3.4 on Windows with library binding both IPv4 and IPv6
Godot version
3.4-Stable
System information
Windows 11
Issue description
This is probably not related to networking at all but here is the case: I’m using MQTTNet library with Godot as my communication framework and it seems to work good with v3.3.4 but with v3.4 of Godot MQTTNet does not connect with the server. There is not error at the console and even when debugging with JetBrains Rider everything seems to run smoothly (besides that it does not connect with the server), MQTT client options are created properly, server IP:Port are correct (It doesn’t look so far that it could be my error). The only thing left to check in order to resolve this would be to keep testing commits and see what breaks this, any tips on what commit that would be is appreciated!
Steps to reproduce
No easy way! If someone can point out which commit might be responsible for this i could do the testing.
Minimal reproduction project
UPDATE
3.4-beta1: Doesn’t even start the project, gives System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
(I’m guessing that was a known issue and was fixed)
3.4-beta2 to 3.4-stable: Same issue. So the issue has been there since 3.4-beta1 (or beta2)
~Possibly related to #54725 ?~
I have attached a sample project to demonstrate the issue, the project connects with a public MQtt broker. If you run the project with 3.3.4 it will print Connected with the server!
in godot log window. If you run it with 3.4 it with print Disconnected from the server!
in the log window.
SampleMqttNetProject.zip
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 17 (12 by maintainers)
So… something more complicated is going on here. I tried to bisect this, and failed: while I can reproduce the issue with the provided example project using the official 3.4-beta2 build (https://downloads.tuxfamily.org/godotengine/3.4/beta2/mono/), I can’t reproduce it if I build 3.4-beta2 myself on Windows (using commit a71169c0e0ed7644b959189522535337bdb6cb2b, which should be 3.4-beta2 according to the Release Notes).
So the official build fails, but a custom one with the same commit succeeds. Any ideas? Maybe the cause is in how the official build is produced?
This is with
mono-6.12.0.107-x64-0.msi
(https://download.mono-project.com/archive/6.12.0/windows-installer/mono-6.12.0.107-x64-0.msi), which seems to be the latest stable Windows release (albeit noticeably older than the one in Akien’s comments above). The preview version (https://download.mono-project.com/archive/6.12.0/windows-installer/mono-6.12.0.165-x64-0.msi) works too, doesn’t seem to make a difference.No actually this confirms that the problem is not with godot-mono-builds either, since the container I used for the test build doesn’t have those changes.
So it’s a regression in Godot itself, which happened between 3.3-stable and 3.4-beta2 (as you pointed out the beta1 mono builds are not usable to test).
Yeah, I can reproduce the issue with the official build on Windows 10 too - and my own build works. Weird.
Edit:
This one reproduces the error for me too. Next step: Having a look at https://github.com/godotengine/build-containers https://github.com/godotengine/godot-mono-builds
Yes, I am on Windows 11. I also tested on Windows 10, though.
So, I’ve now built 3.4-beta2 (https://github.com/godotengine/godot/commit/a71169c0e0ed7644b959189522535337bdb6cb2b) with the following Mono versions on Windows with MSVC: 6.12.0.107 (latest stable on Windows) 6.12.0.144 (preview version) 6.12.0.158 (which seems to be used in official Godot 3.4-beta2) 6.12.0.165 (nightly)
All of these work fine with the provided test project for me, whereas the official Godot 3.4-beta2 build does not. Provided I didn’t miss anything, there seems to be a difference between my builds and the official ones. Not sure how the official ones are built (e.g. which compiler, are they cross compiled from Linux?), need to research.
Thank you @juse4pro 🙏! It seems that after i enforce IPV4 the project works again with 3.4+ versions of Godot. This seems to be more of a Mono issue and if i had to guess its probably caused by a mono upgrade in Godot 3.4 but i’m not certain if i should close this issue or not. @akien-mga