-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
core: Correctly close sockets #2357
Conversation
Co-authored-by: Jonas Vautherin <[email protected]>
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.
Love it, thank you! Keep them coming 😄
Windows CI isn't happy somehow: https://github.com/mavlink/MAVSDK/actions/runs/10061001774/job/27817265595?pr=2357#step:7:55 |
Co-authored-by: Julian Oes <[email protected]>
It turns out that on 64-bit Windows the socket handle is also 64-bit, unlike POSIX systems where it is always For more details see https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64 |
@julianoes , @JonasVautherin I don't have much experience with Windows, could you please check if these lines are necessary in the newly created
|
@fibonacci-matrix I don't know either. If someone that knows Windows complains, we can fix it. |
Should be good to be merged, right @fibonacci-matrix? |
Yes of course, @julianoes |
It is currently not in use, and the default implementation is not suitable because it does not change _fd to INVALID for the object being copied from
|
* core: Correctly close sockets * Update socket_holder.cpp - Fix newline style * Update socket_holder.cpp * Update src/mavsdk/core/tcp_client_connection.cpp Co-authored-by: Jonas Vautherin <[email protected]> * Update socket_holder.cpp - fix code style * Update tcp_client_connection.cpp - fix code style * Update tcp_server_connection.cpp - fix code style * Update socket_holder.h - fix code style * Update src/mavsdk/core/socket_holder.h Co-authored-by: Julian Oes <[email protected]> * Update socket_holder.h - use 64 bit descriptor type on Win64 * Update socket_holder.cpp - use 64 bit descriptor type on Win64 * Update socket_holder.cpp - minor improving of if logic * Remove default move constructor It is currently not in use, and the default implementation is not suitable because it does not change _fd to INVALID for the object being copied from --------- Co-authored-by: Jonas Vautherin <[email protected]> Co-authored-by: Julian Oes <[email protected]>
* core: Correctly close sockets * Update socket_holder.cpp - Fix newline style * Update socket_holder.cpp * Update src/mavsdk/core/tcp_client_connection.cpp Co-authored-by: Jonas Vautherin <[email protected]> * Update socket_holder.cpp - fix code style * Update tcp_client_connection.cpp - fix code style * Update tcp_server_connection.cpp - fix code style * Update socket_holder.h - fix code style * Update src/mavsdk/core/socket_holder.h Co-authored-by: Julian Oes <[email protected]> * Update socket_holder.h - use 64 bit descriptor type on Win64 * Update socket_holder.cpp - use 64 bit descriptor type on Win64 * Update socket_holder.cpp - minor improving of if logic * Remove default move constructor It is currently not in use, and the default implementation is not suitable because it does not change _fd to INVALID for the object being copied from --------- Co-authored-by: Jonas Vautherin <[email protected]> Co-authored-by: Julian Oes <[email protected]>
Closes: #2353