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

Platform dependency / Endianness Issue #4

Open
gmuth opened this issue Jan 1, 2025 · 4 comments
Open

Platform dependency / Endianness Issue #4

gmuth opened this issue Jan 1, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@gmuth
Copy link

gmuth commented Jan 1, 2025

It looks like the BinaryReaderExtension only works for LittleEndian Platforms. On BigEndian Platforms the byte order is also reversed resulting in LittleEndian where BigEndian was already provided.

@gmuth gmuth changed the title Plattform dependency / Endianness Issue Platform dependency / Endianness Issue Jan 1, 2025
@danielklecha
Copy link
Owner

@gmuth How can I fulfill your requirement? Should the IppProtocol include a property IsLittleEndian, and in that case, read the bytes without reversing them?

@gmuth
Copy link
Author

gmuth commented Jan 11, 2025

As far as I remember C# offers isLittleEndian() somewhere.
if isLittleEndian() reverseBytes(...) should do it.

@danielklecha
Copy link
Owner

I found BitConverter.IsLittleEndian but client and server could use different architecture and this check will generate issues. I still think that client must configure it manually or... use bool? and check flag from bitconverter when it's null. It should handle all cases.

@gmuth
Copy link
Author

gmuth commented Jan 12, 2025

The common base is networtbyteorder (bigendian). When server and client use the same byte order the issue is fixed.

@danielklecha danielklecha self-assigned this Jan 12, 2025
@danielklecha danielklecha added the enhancement New feature or request label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants