This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !defined (my.field.type) | |
echo "field | |
endif | |
if type = "number" | |
elsif type = "string" | |
elsif type = "longstr" | |
elsif type = "chunk" | type = "frame" | type = "msg" | type = "list" | type = "hash" | |
elsif type = "msg" | |
if type = "number" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Shows relative performance of zloop timers vs tickets | |
The problem is when you have large numbers of DEALER clients talking | |
to a ROUTER server, and the server wants to expire idle clients with | |
some timeout, e.g. 30 seconds. Using zloop timers, this means deleting | |
and then recreating a timer for each received message. zloop does not | |
order its timers, and even if it did, finding a timer means searching | |
the list, an O(N) cost. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <czmq.h> | |
int main (void) { | |
int repeat; | |
for (repeat = 0; repeat < 1000; repeat++) { | |
zctx_t *ctx = zctx_new (); | |
void *backend = zsocket_new (ctx, ZMQ_DEALER); | |
void *frontend = zsocket_new (ctx, ZMQ_DEALER); | |
int rc = zsocket_bind (backend, "ipc://@/something:%d", repeat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zmq.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main (void) | |
{ | |
void *ctx = zmq_ctx_new (); | |
assert (ctx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: srv.c | |
g++ srv.c /home/eerihug/dev/BakkaLinux/root/usr/local/lib/libzmq.a -lpthread -lrt -o srv | |
g++ cli.c /home/eerihug/dev/BakkaLinux/root/usr/local/lib/libzmq.a -lpthread -lrt -o cli | |
clean: | |
rm cli | |
rm srv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
typedef unsigned char byte; | |
// Maps base 256 to base 85 | |
static char encoder [85 + 1] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <czmq.h> | |
static void * | |
s_source (void *args) | |
{ | |
zctx_t *ctx = zctx_new (); | |
void *pub = zsocket_new (ctx, ZMQ_PUB); | |
zsocket_bind (pub, "tcp://127.0.0.1:9000"); | |
while (true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ZMTP 3.0 subscriber proof-of-concept | |
// Implements http://rfc.zeromq.org/spec:23 with NULL mechanism | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <fcntl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "haywire.h" | |
#include "http_server.h" | |
#include "trie/radix.h" | |
#define CRLF "\r\n" | |
http_response * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Minimal WTFP server in 0MQ | |
#include "czmq.h" | |
static void * | |
wtfp_server (void *args) | |
{ | |
zctx_t *ctx = zctx_new (); | |
void *router = zsocket_new (ctx, ZMQ_ROUTER); | |
int rc = zsocket_bind (router, "tcp://*:8080"); | |
assert (rc != -1); |