ansys / ansys/api-eigen-example

vector serialization does not take into account endianness

Open
#53 4 comments 0 reactions 0 assignees View on GitHub
C++ gRPC Python
Dominant language
Python
Stars
8
Forks
0
Avg merge
11h 54m
Merged PRs (30d)
10

Description

The [gRPC protocol is defined](https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/protos/grpcdemo.proto#L21) as sending over the bytes of arrays directly, but does not take into account endianness. This means the protocol will fail spectacularly (type 3 error, bad data with no error) if the client and server machines have different native endianness.

https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/cpp/grpc/client/src/GRPCClient.cpp#L499

https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/python/grpc/client.py#L280

Unless there is another reason, I recommend using gRPC arrays instead of bytes. gRPC can handle this for us.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.