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

Retransmit is a protocol detail and should not be implemented in the client #8

Closed
franc0is opened this issue Sep 7, 2015 · 2 comments

Comments

@franc0is
Copy link
Contributor

franc0is commented Sep 7, 2015

All of the POSIX examples implement the re-transmit part of the standard in the application code, mostly to make up for the fact that it isn't implemented in the library itself.

E.g. in examples/client.c:

  [...]
  while ( !(ready && coap_can_exit(ctx)) ) {
    FD_ZERO(&readfds);
    FD_SET( ctx->sockfd, &readfds );

    nextpdu = coap_peek_next( ctx );

    coap_ticks(&now);
    while (nextpdu && nextpdu->t <= now - ctx->sendqueue_basetime) {
      coap_retransmit( ctx, coap_pop_next( ctx ));
      nextpdu = coap_peek_next( ctx );
    }
  [...]

This is unsanitary and breaks many of the abstractions in obvious ways. For example, the coap_context_t object when compiled with -DWITH_POSIX keeps a reference to the socket so that - and this is the only reason as far as I can tell - the client can use it in its re-transmit code.

The Contiki & lwIP ports implement re-transmit in the library, which makes the above fact even more puzzling.

@franc0is franc0is changed the title Retransmit is a protocol detail and shouldn't be implemented in the client Retransmit is a protocol detail and should not be implemented in the client Sep 7, 2015
@obgm
Copy link
Owner

obgm commented Sep 7, 2015 via email

@obgm
Copy link
Owner

obgm commented Apr 28, 2020

This has been resolved in the meantime by the coap_io_process() interface. Closing.

@obgm obgm closed this as completed Apr 28, 2020
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 9, 2022
Small adjustment so vim isn't complaining about wrong modlines any more.
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 13, 2022
Small adjustment so vim isn't complaining about wrong modlines any more.
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 17, 2022
Small adjustment so vim isn't complaining about wrong modlines any more.
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 20, 2022
Small adjustment so vim isn't complaining about wrong modlines any more.
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Dec 30, 2022
Small adjustment so vim isn't complaining about wrong modlines any more.
mrdeep1 added a commit to mrdeep1/libcoap that referenced this issue Jan 2, 2023
Small adjustment so vim isn't complaining about wrong modlines any more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants