This limitation should perhaps at least be documented, better yet fixed for those who run multiple clients and want to use a base config as starting point.
Steps to reproduce:
FutureOr<void> main(List<String> args) async {
// intended for client1
final conf1 = CoapConfig();
// intended for client2, default config but different port (example)
final conf2 = CoapConfig()..defaultPort = 1234;
final uri = Uri(scheme: 'coap', host: 'coap.me', port: conf1.defaultPort);
final client1 = CoapClient(uri, conf1);
final request = CoapRequest.newGet();
request.addUriPath('large');
client1.request = request;
await client1.get();
client1.close();
}
This limitation should perhaps at least be documented, better yet fixed for those who run multiple clients and want to use a base config as starting point.
Steps to reproduce:
Output:
Workaround, set
spec
manually: