Home > Mobile >  What is the role of struct data member aeron_udp_channel_transport_stct::bindings_clientd in Aeron C
What is the role of struct data member aeron_udp_channel_transport_stct::bindings_clientd in Aeron C

Time:11-08

The aeron_udp_channel_transport_stct::bindings_clientd is only found be used in aeron_udp_channel_transport_init function which set the bindings_clientd to NULL without further operations. Except some modification and assert in test cases.

In the test case, it is assigned as struct aeron_test_udp_bindings_state_stct, which containes some state counter.

What role does this data member play in Aeron? What is the proper usage of bindings_clientd?

CodePudding user response:

TL;DR unless you are writing a custom network binding don't concern yourself with this field.

The Aeron C driver has support for adding different network bindings implementations (see aeron_udp_channel_transport_bindings_stct). In the OSS repo there is only support for UDP. However, if a user wanted to add an additional implementation that used a different network API and needed to carry some implementation specific information on each transport instance, this would be the field to add it to. In theory for the UDP implementation, it could be refactored towards having a structure that held the file descriptors here.

The test driver carries some state information in that field so that behaviour can be asserted within the tests. There also exists commercial extensions to the C driver (e.g. for DPDK) that make use of this field too.

  • Related