shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

Multicast requests using blockwise currently not working #100

Closed JKRhb closed 1 year ago

JKRhb commented 2 years ago

In the current version of the library, using multicast with block-wise transfer currently does not work anymore, as the client checks if the response's token matches the one of the original request.

https://github.com/shamblett/coap/blob/3f03f45e66ca4102ce729a95a0477fab4acd1292/lib/src/coap_client.dart#L474

However, because the client switches to unicast when using block-wise transfer with a server, this check always returns false because a new token is assigned once the switch is made. I will try to come up with a fix for this problem in the next couple of days.

Maybe the check could simply return true if multicast is being used, like so?

.where((final e) => req.multicast || e.resp.token!.equals(req.token!))

Or could we add a field for an "original token" somewhere, which could be used for matching instead?

JosefWN commented 2 years ago

Ah, ouch. The token for the "overarching" request is set in the exchange when fireRespond is called: https://github.com/shamblett/coap/blob/4.2.1/lib/src/net/coap_exchange.dart#L154

For blockwise this is the last token in the blockwise exchange.

I can test a bit too. Just for reference, server that could be used for testing (can be modified to return blockwise): https://github.com/plgd-dev/go-coap/tree/master/examples/mcast/server

Client:

FutureOr<void> main(final List<String> args) async {
  final conf = CoapConfig();
  final uri = Uri(
    scheme: 'coap',
    host: CoapDefinedAddress.allCOAPNodesIPV4,
    port: conf.defaultPort,
  );
  final client = CoapClient(uri, conf);

  try {
    final req = CoapRequest.newGet()..uriPath = '/oic/res';
    await client.send(
      req,
      onMulticastResponse: CoapMulticastResponseHandler(print),
    );
  } on Exception catch (e) {
    print('CoAP encountered an exception: $e');
  }

  client.close();
}

Maybe the check could simply return true if multicast is being used, like so?

I think this wouldn't work if you have two different multicast requests running concurrently, then there would be no filtering mechanism between responses for the two?

EDIT: I think multicast block1 requests are not supported as per the RFC, which leaves block2 for us to investigate: https://datatracker.ietf.org/doc/html/rfc7959#section-2.8

Other uses of the Block options [than block2] in conjunction with multicast messages are for further study.

The go-coap server seems to ignore block1 requests, emitting the error "message is truncated", since it's not anticipating a block1 request, but block2 seems to work for me with multicast?

JKRhb commented 2 years ago

Thank you, @JosefWN, for your investigation and the minimal example :)

I think this wouldn't work if you have two different multicast requests running concurrently, then there would be no filtering mechanism between responses for the two?

Yeah, I just realized this as well :/ Maybe a handler method could simply check if a final response with the same token from the same endpoint already has arrived and ignore it if that should be the case?

I think multicast block1 requests are not supported as per the RFC, which leaves block2 for us to investigate: https://datatracker.ietf.org/doc/html/rfc7959#section-2.8

Good point :)

The go-coap server seems to ignore block1 requests, emitting the error "message is truncated", since it's not anticipating a block1 request, but block2 seems to work for me with multicast?

Hmm, I haven't tried out the go-coap server yet, but sending a multicast request for retrieving a block-wise resource also works fine in theory for me (see the Wireshark log below where I used an ESP32 for running a CoAP server). However, after the exchange is completed, the result is not passed to the CoapMulticastResponseHandler and is also not returned as a response, causing the example to hang for me.

Wireshark log ```csv No. Time Source Destination Prot. Length Info 40 4.480158 fe80::953:6cb0:9482:d615 ff02::fd CoAP 111 NON, MID:18638, GET, TKN:d1 2e a5 da 64 1b 68 56, /.well-known/wot-thing-description 41 4.594423 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 NON, MID:18638, 2.05 Content, TKN:d1 2e a5 da 64 1b 68 56, Block #0, /.well-known/wot-thing-description 42 4.618614 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18639, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #1, /.well-known/wot-thing-description 43 4.625163 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18639, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #1, /.well-known/wot-thing-description 44 4.628312 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18640, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #2, /.well-known/wot-thing-description 45 4.634593 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18640, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #2, /.well-known/wot-thing-description 46 4.635830 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18641, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #3, /.well-known/wot-thing-description 47 4.647436 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18641, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #3, /.well-known/wot-thing-description 48 4.648508 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18642, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #4, /.well-known/wot-thing-description 49 4.657108 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18642, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #4, /.well-known/wot-thing-description 50 4.658267 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18643, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #5, /.well-known/wot-thing-description 51 4.663946 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18643, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #5, /.well-known/wot-thing-description 52 4.664941 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18644, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #6, /.well-known/wot-thing-description 53 4.670592 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18644, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #6, /.well-known/wot-thing-description 54 4.671411 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18645, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #7, /.well-known/wot-thing-description 55 4.678059 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18645, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #7, /.well-known/wot-thing-description 56 4.679070 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18646, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #8, /.well-known/wot-thing-description 57 4.685514 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18646, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #8, /.well-known/wot-thing-description 58 4.686347 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18647, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #9, /.well-known/wot-thing-description 59 4.696673 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18647, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #9, /.well-known/wot-thing-description 60 4.698227 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18648, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #10, /.well-known/wot-thing-description 61 4.704497 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18648, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #10, /.well-known/wot-thing-description 62 4.705387 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18649, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #11, /.well-known/wot-thing-description 63 4.711277 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18649, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #11, /.well-known/wot-thing-description 64 4.712262 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18650, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #12, /.well-known/wot-thing-description 65 4.718967 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18650, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #12, /.well-known/wot-thing-description 66 4.719815 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18651, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #13, /.well-known/wot-thing-description 67 4.725972 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18651, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #13, /.well-known/wot-thing-description 68 4.726952 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18652, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #14, /.well-known/wot-thing-description 69 4.735008 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18652, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #14, /.well-known/wot-thing-description 70 4.736464 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 113 CON, MID:18653, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #15, /.well-known/wot-thing-description 71 4.742705 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 96 ACK, MID:18653, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #15, /.well-known/wot-thing-description 72 4.743783 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18654, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #16, /.well-known/wot-thing-description 73 4.749885 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18654, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #16, /.well-known/wot-thing-description 74 4.750778 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18655, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #17, /.well-known/wot-thing-description 75 4.762487 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18655, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #17, /.well-known/wot-thing-description 76 4.763489 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18656, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #18, /.well-known/wot-thing-description 77 4.769885 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18656, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #18, /.well-known/wot-thing-description 78 4.770876 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18657, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #19, /.well-known/wot-thing-description 79 4.781902 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18657, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #19, /.well-known/wot-thing-description 80 4.783384 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18658, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #20, /.well-known/wot-thing-description 83 4.793339 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18658, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #20, /.well-known/wot-thing-description 86 4.794454 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18659, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #21, /.well-known/wot-thing-description 90 4.800619 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18659, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #21, /.well-known/wot-thing-description 91 4.801559 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18660, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #22, /.well-known/wot-thing-description 92 4.807415 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18660, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #22, /.well-known/wot-thing-description 93 4.808242 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18661, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #23, /.well-known/wot-thing-description 94 4.816612 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18661, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #23, /.well-known/wot-thing-description 95 4.817806 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18662, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #24, /.well-known/wot-thing-description 96 4.823685 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18662, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #24, /.well-known/wot-thing-description 97 4.824498 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18663, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #25, /.well-known/wot-thing-description 98 4.832155 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18663, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #25, /.well-known/wot-thing-description 99 4.833124 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18664, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #26, /.well-known/wot-thing-description 100 4.842166 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18664, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #26, /.well-known/wot-thing-description 101 4.844125 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18665, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #27, /.well-known/wot-thing-description 102 4.850328 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18665, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #27, /.well-known/wot-thing-description 103 4.851269 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18666, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #28, /.well-known/wot-thing-description 104 4.860046 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18666, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #28, /.well-known/wot-thing-description 105 4.861017 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18667, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #29, /.well-known/wot-thing-description 106 4.868211 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18667, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #29, /.well-known/wot-thing-description 107 4.869188 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18668, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #30, /.well-known/wot-thing-description 108 4.875491 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18668, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #30, /.well-known/wot-thing-description 109 4.876456 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18669, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #31, /.well-known/wot-thing-description 110 4.883238 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18669, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #31, /.well-known/wot-thing-description 111 4.884154 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18670, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #32, /.well-known/wot-thing-description 112 4.890275 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18670, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #32, /.well-known/wot-thing-description 113 4.891124 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18671, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #33, /.well-known/wot-thing-description 114 4.901235 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18671, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #33, /.well-known/wot-thing-description 115 4.902643 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18672, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #34, /.well-known/wot-thing-description 116 4.911259 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18672, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #34, /.well-known/wot-thing-description 117 4.912239 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18673, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #35, /.well-known/wot-thing-description 118 4.918240 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18673, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #35, /.well-known/wot-thing-description 119 4.919061 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18674, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #36, /.well-known/wot-thing-description 120 4.927541 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18674, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #36, /.well-known/wot-thing-description 121 4.928573 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18675, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #37, /.well-known/wot-thing-description 122 4.934994 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18675, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #37, /.well-known/wot-thing-description 123 4.935815 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18676, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #38, /.well-known/wot-thing-description 124 4.943579 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18676, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #38, /.well-known/wot-thing-description 125 4.944603 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18677, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #39, /.well-known/wot-thing-description 126 4.950659 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18677, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #39, /.well-known/wot-thing-description 127 4.951701 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18678, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #40, /.well-known/wot-thing-description 128 4.964432 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18678, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #40, /.well-known/wot-thing-description 129 4.966553 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18679, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #41, /.well-known/wot-thing-description 130 4.973159 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18679, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #41, /.well-known/wot-thing-description 131 4.974199 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18680, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #42, /.well-known/wot-thing-description 132 4.986412 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18680, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #42, /.well-known/wot-thing-description 133 4.987584 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18681, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #43, /.well-known/wot-thing-description 134 4.997873 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18681, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #43, /.well-known/wot-thing-description 135 4.998788 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18682, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #44, /.well-known/wot-thing-description 136 5.005183 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18682, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #44, /.well-known/wot-thing-description 137 5.005987 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18683, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #45, /.well-known/wot-thing-description 138 5.014710 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18683, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #45, /.well-known/wot-thing-description 139 5.015700 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18684, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #46, /.well-known/wot-thing-description 140 5.021941 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18684, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #46, /.well-known/wot-thing-description 141 5.022957 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18685, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #47, /.well-known/wot-thing-description 142 5.032138 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18685, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #47, /.well-known/wot-thing-description 143 5.033862 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18686, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #48, /.well-known/wot-thing-description 144 5.041244 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18686, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #48, /.well-known/wot-thing-description 145 5.042592 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18687, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #49, /.well-known/wot-thing-description 146 5.050331 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18687, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #49, /.well-known/wot-thing-description 147 5.051075 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18688, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #50, /.well-known/wot-thing-description 148 5.065023 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18688, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #50, /.well-known/wot-thing-description 149 5.065952 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18689, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #51, /.well-known/wot-thing-description 150 5.078878 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18689, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #51, /.well-known/wot-thing-description 151 5.080414 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18690, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #52, /.well-known/wot-thing-description 152 5.089790 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18690, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #52, /.well-known/wot-thing-description 153 5.090589 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18691, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #53, /.well-known/wot-thing-description 154 5.101814 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18691, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #53, /.well-known/wot-thing-description 155 5.103164 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18692, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #54, /.well-known/wot-thing-description 156 5.110255 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18692, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #54, /.well-known/wot-thing-description 157 5.111196 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18693, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #55, /.well-known/wot-thing-description 158 5.117480 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18693, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #55, /.well-known/wot-thing-description 159 5.118372 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18694, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #56, /.well-known/wot-thing-description 160 5.124851 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18694, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #56, /.well-known/wot-thing-description 161 5.126827 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18695, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #57, /.well-known/wot-thing-description 162 5.135050 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 97 ACK, MID:18695, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, Block #57, /.well-known/wot-thing-description 163 5.136150 fe80::953:6cb0:9482:d615 fe80::260a:c4ff:feea:20f0 CoAP 114 CON, MID:18696, GET, TKN:e8 c8 b8 89 2f f2 88 cf, Block #58, /.well-known/wot-thing-description 164 5.143442 fe80::260a:c4ff:feea:20f0 fe80::953:6cb0:9482:d615 CoAP 90 ACK, MID:18696, 2.05 Content, TKN:e8 c8 b8 89 2f f2 88 cf, End of Block #58, /.well-known/wot-thing-description ```
JosefWN commented 2 years ago

Ah, my bad, I was printing all of the events and must have mistaken CoapRespondingEvent for CoapRespondEvent. Will dig a bit more, it could have to do with how the exchange is duplicated.

JosefWN commented 2 years ago

Yeah, tried and it works in v3.5.0, so it was my refactor.

An attempt at a fix with a multicast token like you were thinking of: https://github.com/shamblett/coap/pull/102

JosefWN commented 1 year ago

We can keep this open until this is fixed:

Thank you, @JosefWN, block-wise multicast requests now work again :) The only thing I noticed is that the client seems to hang if you use multicast even if you explicitly close it. Unfortunately, I haven't been able to find the point where to fix the issue yet. Destroying the eventBus in the client, for example, does not have an effect on the behavior.

EDIT: Just in case, can you try with this PR: https://github.com/shamblett/coap/pull/109

See if it makes any difference.

shamblett commented 1 year ago

Believe this has been addressed. Package re released at version 5.0.0.