Coder Social home page Coder Social logo

Comments (10)

wuyingfengsui avatar wuyingfengsui commented on June 26, 2024

Have you try the example? I think it can be work just change the client method get to put

from coap-rs.

sheosi avatar sheosi commented on June 26, 2024

It might be because client and server are in different threads in the example? I might have to try that.

from coap-rs.

sheosi avatar sheosi commented on June 26, 2024

Gave it a try, using that same example and changing CoAPClient::get(url) with CoAPClient::put(url, vec![]) gives the same error as before.

from coap-rs.

wuyingfengsui avatar wuyingfengsui commented on June 26, 2024

let response = CoAPClient::put(url, vec![]).unwrap(); works on my computer. Which OS you are using?

from coap-rs.

sheosi avatar sheosi commented on June 26, 2024

from coap-rs.

wuyingfengsui avatar wuyingfengsui commented on June 26, 2024

Maybe. The error occur on a non-blocking socket. The linux has its' own non-blocking system. Have you try to start the client a little later?

from coap-rs.

sheosi avatar sheosi commented on June 26, 2024

That was it, adding a barrier (a oneshot channel too, pretty much anything to sync them up) was enough for the example to work. I still think the underlying problem is not resolved, but maybe this could be added as a workaround? It would be useful to have this in an example, as part of the documentation or even inside the library itself (if it makes sense).

from coap-rs.

wuyingfengsui avatar wuyingfengsui commented on June 26, 2024

It relates to the OS type. Only a few of OS has the problem. I will add some comments in the example later.

from coap-rs.

sheosi avatar sheosi commented on June 26, 2024

Also, add that the thread is mandatory, otherwise it produces an error as well.

from coap-rs.

Covertness avatar Covertness commented on June 26, 2024

commented

from coap-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.