-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add basic logic for g_socket #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tiny changes prevent very hard to debug memory errors
It looks like you have to add some build flags to prevent building the GSocket on Windows, so that Windows users can still use the library. |
let try to fix it with generics. |
You could also handle it like the golangs syscall package itself handles the multiple systems: https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/syscall/syscall_linux.go;l=1207. If you cannot test it in Windows I would be okay with it if you only provide an implementation for Linux (and MacOS, which already works), and leave the further implementation to someone that can test it. I myself cannot test it either, I fully rely on the GitHub pipeline. |
run pipeline plz, let check windows build. I can't run myself without approval I think the example you gave will not work because in our case there are no two different functions to call, it is one, but with different types of argument depending on which file will participate in the build. Perhaps we can do without generics by explicitly converting the type to int - this will be ok for windows (uintptr -> int), and will be a truism for linux (int -> int), which may cause warnings, but it's still ok |
My proposal was rather: don't provide an implementation for windows. If an implementation for windows is desired, then the function could also have completely different arguments, no need to provide an abstraction to unify the different systems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work now in our pipeline. Can you add some docs, please? The I would be happy to merge
@NoobsEnslaver Thanks for your contribution |
Hi, it's needed for ability to share socket between udpsrc and udpsink - it is common case for NAT traversal