Skip to content

[FEATURE] Add a timeout to TransportArbitrator for clientReceive #367

@adadaadadade

Description

@adadaadadade

Is your feature request related to a problem? Please describe.
If for some reason, transmission is failed. Therefore, client will not able to receive any response from server. But TransportArbitrator will stuck forever because it is waiting for semaphore.

erpc_status_t TransportArbitrator::clientReceive(client_token_t token)
{
erpc_assert((token != 0) && ("invalid client token" != NULL));
// Convert token to pointer to info struct for this client receive request.
PendingClientInfo *info = reinterpret_cast<PendingClientInfo *>(token);
// Wait on the semaphore until we're signaled.
info->m_sem.get(Semaphore::kWaitForever);
removePendingClient(info);
return kErpcStatus_Success;
}

ClientManager do not have this porblem because it doesn't wait for semaphore.

Describe the solution you'd like
I know unreliable transport causes this problem. but it is inefficient to implement a reliable transport for serial and spi. It will need a ack from the other side.

  • Maybe add a timeout option for TransportArbitrator and ArbitratedClientManager
  • do nothing

Describe alternatives you've considered

Steps you didn't forgot to do

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions