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

Split SystemException to handle Windows #1833

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

CendioOssman
Copy link
Member

Windows has (at least) two error namespaces, both errno and GetLastResult(). These overlap, so it is important we keep track of which one we are dealing with.

To make things extra problematic, the BSD socket API normally uses errno, but on Windows it has been mapped in to the GetLastResult() namespace.

Try to keep better control of this by using separate classes for the namespaces.

Copy link
Member

@samhed samhed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think this makes things clearer and easier to understand. Nice to hear that it fixes a few incorrect errors as well.

One small thing; Looks like a typo in the commit message "Mocket SocketException to rdr", I guess it should be "Move ...".

Socket APIs are used in more places than the abstraction in
common/network. Make it easier to use this exception class by putting
it in a more common place.
The behaviour is not consistent as Windows doesn't use errno for socket
errors, but Unix systems do. Always use the same exception to keep
things somewhat sane.
Windows has (at least) two error namespaces, both errno and
GetLastResult(). These overlap, so it is important we keep track of
which one we are dealing with.

To make things extra problematic, the BSD socket API normally uses
errno, but on Windows it has been mapped in to the GetLastResult()
namespace.

Try to keep better control of this by using separate classes for the
namespaces.
@CendioOssman CendioOssman merged commit e758979 into TigerVNC:master Oct 9, 2024
11 checks passed
@CendioOssman CendioOssman deleted the errno branch October 9, 2024 11:57
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.

2 participants