4 ms·
Can someone explain what's so special about these libraries that make then "better" than raw sockets?
by senatorobama 9y ago
Can someone explain what's so special about these libraries that make then "better" than raw sockets?
- braywill 9y agoThey'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.
- aidenn0 9y agoBerkeley 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.
- dguaraglia 9y agoOne 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 http://zguide.zeromq.org/page:all