Skip to content

Instantly share code, notes, and snippets.

The Internet Protocol dominates 100% of the networking market but this was not always inevitable. In 1995 Microsoft launched Windows 95, a desktop product that had no Internet but instead used a proprietary network, the Microsoft Network (MSN). The MSN and AOL walled gardens failed, as did every other attempt to capture the growing Internet in private networks. Following Internet's move onto every computer, society, economics, and even politics have gone digital to an extent that was impossible to foresee even ten years ago.
Why did the Internet dominate? It is owned by no-one, not patented, not subsidised, and represents no dominate market interest. Unlike the GSM stack, Windows, Internet looks like an orphan technology that should have been easily quashed by private interests.
The answer is exactly in this lack of centralized ownership. By 1995 Internet was already the standard for connecting the leading edge around the world. With no patents or taxes on the technology, and a clear set of interoper
<config>
<device type="forwarder|streamer|queue">
<in>
<bind addr="zmq_bind() endpoint" />
<connect addr="zmq_connect() endpoint" />
</in>
<out>
<bind addr="zmq_bind() endpoint" />
<connect addr="zmq_connect() endpoint" />
</out>
//
// Provoke assertion failure in sub.cpp:45
//
#include <zmq.h>
int main () {
void *context; // ØMQ context for our process
context = zmq_init (1);
void *s2;
<class
name = "hello"
title = "The Hello Protocol"
script = "zproto_codec_c"
package_dir = "."
>
This is a hello world example.
<message name = "HELLO">
Client sends request
<field name = "request" type = "string" />
<class
name = "sadl_msg"
title = "The SADL Message Protocol"
script = "zproto_codec_c"
package_dir = "."
>
This implements the wireframe SADL protocol
<message name = "PUBLISH">
Client sends data to a topic
//
// Provoke assertion:
// Assertion failed: !engine (session.cpp:287)
// Caused by two clients with same identity
//
#include "zhelpers.h"
void *host_routine (void *context) {
// Socket to talk to dispatcher
void *host = zmq_socket (context, ZMQ_PULL);
//
// Demonstrate identities as used by the request-reply
// pattern. Run this program by itself.
// (provokes assertion failure in xrep.cpp)
//
#include "zhelpers.h"
// Receives all message parts from socket, prints neatly
//
static void
/* testclient.c program to emit one 2-part message to testpub.c */
#include "zhelpers.h"
int main (int argc, char **argv) {
void *ctx = zmq_init (1);
assert (ctx);
void *client = zmq_socket(ctx, ZMQ_REQ);
assert (client);
/*
Reproduces freeze in 0MQ
1. Run, application hangs on zmq_close
*/
#include <zmq.h>
int main (int argc, char *argv[])
{
void *context = zmq_init (1);
/*
Reproduces segmentation fault in 0MQ
1. Start in two windows
myname d1 d2
myname d2 d1
2. Kill either instance
3. Other instance crashes
#0 0x04f6e824 in ?? ()
#1 0x00152ac9 in zmq::session_t::activated (this=0x8054088, pipe_=0x8056598) at session.cpp:152