D
D
Decker2017-10-27 12:15:15
JavaScript
Decker, 2017-10-27 12:15:15

How to use nanomsg in an application compiled with Emscripten?

There is a fairly large and complex C project that uses the nanomsg library to work with the network. The task is to build it with Emscripten in JS. However, here we ran into a problem, in principle, everything is already assembled, with the exception of function calls from nanomsg. As far as I understand, there are no nanomsg "ports" that would be successfully assembled by Emscripten. The only thing that I managed to find is the nanomsg for node module for nodejs. But how to use it from the C sources compiled by Emscripten is still unclear. In this connection, the question is - has anyone had experience building applications using Emscripten that use nanomsg? Maybe someone wrote wrapper C -> nodejs-nanomsg or something similar?
If we reduce the task to a simplified one, then we need to build two examples using nanomsg using Emscripten:

  • Pipeline (A One Way Pipe)
  • Pub/Sub (Topics & Broadcast)

As you can see, they all use nn_socket, nn_bind, nn_send and other functions from nanomsg. I would appreciate any help.
ps Links to projects successfully built by Emscripten and using nanomsg are highly welcome.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question