dysinger / nanomsg-examples Goto Github PK
View Code? Open in Web Editor NEWExamples of different message types in C with nanomsg
Examples of different message types in C with nanomsg
I have taking the examples and wrapped them up into individual files and scripts, as documented for other's convenience. Use them if you'd like.
If arguments are not provided, the examples will segfault (on mac, at least).
I'm trying to compile pubsub.c in my Fedora box, but gcc complains with this:
pubsub.c:2:18: fatal error: libc.h: No such file or directory.
I solved this problem by replacing the libc.h include statement with below:
#include <semaphore.h>
#include <pthread.h>
#include <netdb.h>
#include <time.h>
#include <string.h>
and linked with -lpthread -lanl
PS: Someone post this in stackoverflow: http://stackoverflow.com/questions/21768542/libc-h-no-such-file-or-directory-when-compiling-nanomsg-pipeline-sample
Hi.
See here:
https://github.com/Laeeth/d-nanomsg
I hope it was okay to port your examples to D. I have included them in the repository for ease of use. Please let me know if you are not happy with this - and if you are, could you let me know the license that should apply so I can update the LICENSE file.
Also, I think on your website the reqrep is a duplicate of pipeline (it is correct in your repository).
Thanks.
Laeeth.
who have req/rep with nn_device code example?
thanks a lot
The code for Request/Reply in the blog (http://tim.dysinger.net/posts/2013-09-16-getting-started-with-nanomsg.html) is not the good one. It's the same code as the pipeline. On github it's the good one.
I think it's crucial to understand when to bind (one waiting on sth.) or when to connect (many awaiting sth.).
You actually made a pipeline example where the (one) PULL worker is bound and the (or multiple) PUSH workers are connect'ing to their sockets.
On the other side, the test program in nanomsg shows an example where the (one) PUSH worker is bound and the (or multiple) PULL workers are connect'ing to their sockets.
In a NNanomsg multi REQ/REP example (not just a MsgPack test) using nn_device (RAW REP, RAW REQ), I'm connecting REQ and also connect'ing the REP socket (to their respective bound RAW sockets).
Discovering this by learning in doing, I believe this is crucial to understand nanomsg!
typo?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.