News for hackers. Stuff that matters.
Re:Rationale: Or why am I bothering to rewrite nanomsg? by senatorobama on Monday April 09, 2018 @07:11PM (#16797801)
Can someone explain what's so special about these libraries that make then "better" than raw sockets?
Re:Rationale: Or why am I bothering to rewrite nanomsg? by braywill on Monday April 09, 2018 @07:15PM (#16797822)
They're not better than raw sockets, they're simply an abstraction layer on top of them.

For example, building a message queuing service using raw sockets that works on Windows, Mac OS, and Linux is quite the undertaking. With ZeroMQ (and I'm assuming nanomsg as well), it's quite simple.

ZeroMQ and nanomsg are like raw socket toolboxes.

Re:Rationale: Or why am I bothering to rewrite nanomsg? by aidenn0 on Monday April 09, 2018 @08:07PM (#16798027)
Berkeley style TCP sockets let you connect to/listen from and endpoint and transfer bytes.

That's pretty cool, but what if you want to send messages rather than raw bytes. What if you want to do publish/subscribe rather than send/receive to a single endpoint? &c.

ZeroMQ implements simple things like that that are often implemented differently in an ad-hoc manner.

Re:Rationale: Or why am I bothering to rewrite nanomsg? by dguaraglia on Monday April 09, 2018 @08:19PM (#16798082)
One of the features I recall liking about the ZMQ "family" of implementations is that they handle a lot of the error handling/reconnection for you.

The ZMQ guide is actually a great document to read in general terms, I recommend reading it if you are curious about the architectural rationale (which you could, actually, re-implement in your own raw socket protocol): http://zguide.zeromq.org/page:all