Coder Social home page Coder Social logo

Comments (5)

shikokuchuo avatar shikokuchuo commented on September 3, 2024

I am re-resting this with the latest NNG build and an updated version of my code. The characterisation above was unfortunately incorrect - it was the long-running task that sometimes did not exit (this is also re-spawned periodically).

If I had to guess, it would be a deadlock upon closing a websocket stream. But this is possibly my error and not the library. Hope to report back shortly.

from nng.

shikokuchuo avatar shikokuchuo commented on September 3, 2024

It seems to be resolved. FYI I think the issue was a deadlock on stream dialer close on a 'wss' stream, as I was not building libmbedtls with pthread support (needs to be enabled in 'mbedtls_config.h').

There is nothing gating from my side now for an NNG 1.6.0 release. Thanks, and apologies for raising a false concern!

from nng.

alawn-wang avatar alawn-wang commented on September 3, 2024

It seems to be resolved. FYI I think the issue was a deadlock on stream dialer close on a 'wss' stream, as I was not building libmbedtls with pthread support (needs to be enabled in 'mbedtls_config.h').

There is nothing gating from my side now for an NNG 1.6.0 release. Thanks, and apologies for raising a false concern!

Hi, i want to build a websocket server use NNG, but there seems just a little information about this, no matter in docs or codes.
The problem which most confused me is that if just use simple rep/req mode how can i create a new websocket server? If i use http api, this seems will totally become a http server, just like nng/demo/rest?
Could you please tell me how you solved this problem?

from nng.

shikokuchuo avatar shikokuchuo commented on September 3, 2024

In that particular case, I was in fact using SP over WebSocket i.e. req/rep. If that's all you mean, then just specify a URL with the scheme 'ws://' instread of 'tcp://' in your listen / dial.

If you want to create an actual WebSocket server (speaking to a non-NNG client), then you need the low-level stream interface, and look into setting options for 'ws:recv-text' and 'ws:send-text' if you need to deal with text rather than binary frames.

I maintain the R language binding and there is quite extensive documentation there (https://shikokuchuo.net/nanonext/), which may help provide some intuitive grounding.

from nng.

alawn-wang avatar alawn-wang commented on September 3, 2024

In that particular case, I was in fact using SP over WebSocket i.e. req/rep. If that's all you mean, then just specify a URL with the scheme 'ws://' instread of 'tcp://' in your listen / dial.

If you want to create an actual WebSocket server (speaking to a non-NNG client), then you need the low-level stream interface, and look into setting options for 'ws:recv-text' and 'ws:send-text' if you need to deal with text rather than binary frames.

I maintain the R language binding and there is quite extensive documentation there (https://shikokuchuo.net/nanonext/), which may help provide some intuitive grounding.

Thanks for your reply.
It's unforunately that may be i need create a real WebSocket Server. Because it should need received multi-clients connections and transport information with them, although client&server communication by NNG.

from nng.

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.