Code: Select all
conn_if_t all_conns [3]; // parameter in setup of Server1
void Server1 (
server conn_if_t i_conns[3]); {
while (1) {
select {
case i_conns[unsigned iof_client].do_temp (const unsigned val_in) -> unsigned val_return : {
// iof_client is [0..2]
...
Code: Select all
conn_if_t all_conns [8][3]; // parameter in setup of Servers8 are now all_conns[0], all_conns[1], all_conns[2], ie. I have 8 of Servers8
void Servers8 (
server conn_if_t i_conns[3]); {
unsigned my_array [3];
while (1) {
select {
case i_conns[unsigned iof_client].do_temp (const unsigned val_in) -> unsigned val_return : {
// iof_client is [0..23], in groups of [0..2], [3..5], ... [21,22,23] for the 8 Servers8
const unsigned usable_index = (iof_client % 3); // [0..2] to avoid 'out of range' crash
my_array[usable_index] = val_in;
...
But I couldn't find any reference to it in any of the documentation..?