Skip to content

Instantly share code, notes, and snippets.

Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am thomasluce on github.
  • I am thomasluce (https://keybase.io/thomasluce) on keybase.
  • I have a public key ASCIbRzpQrVmW3X4Cldg9aROWyFM_k7enXna648o9Nh8Zwo
@thomasluce
thomasluce / pubsub.c
Created January 3, 2011 21:25
a simple publisher and subscriber using zeromq
########################### pub.c ##########################################
#include "zmq.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
void *context = zmq_init(1);
void *socket = zmq_socket(context, ZMQ_PUB);
zmq_connect(socket, "tcp://127.0.0.1:12345");
@thomasluce
thomasluce / queue.c
Created December 30, 2010 19:28
gcc -g3 -o queue -I/opt/local/include -lzmq queue.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <zmq.h>
#include <assert.h>
char in_connect[1000] = "";
char out_connect[1000] = "";