Skip to content

Instantly share code, notes, and snippets.

View sustrik's full-sized avatar

Martin Sustrik sustrik

View GitHub Profile
diff --git a/src/dist.cpp b/src/dist.cpp
index 093da79..9201294 100644
--- a/src/dist.cpp
+++ b/src/dist.cpp
@@ -23,9 +23,11 @@
#include "err.hpp"
#include "own.hpp"
#include "msg.hpp"
+#include "likely.hpp"
# Force not to use eventfd
AC_ARG_ENABLE([eventfd], [AS_HELP_STRING([--disable-eventfd], [disable eventfd [default=no]])],
[disable_eventfd=yes], [disable_eventfd=no])
eventfd_headers="no"
eventfd_can_run="no"
if test "x$disable_eventfd" != "xyes"; then
# Check if we have eventfd.h header file.
AC_CHECK_HEADERS(sys/eventfd.h, [eventfd_headers=yes])
#include <zmq.hpp>
int main ()
{
zmq::context_t ctx (1);
zmq::socket_t s (ctx, ZMQ_REQ);
zmq::pollitem_t pi;
pi.socket = s;
pi.events = ZMQ_POLLIN;
--- a/src/router.cpp
+++ b/src/router.cpp
@@ -123,7 +123,7 @@ int zmq::router_t::xsend (msg_t *msg_, int flags_)
// If we have malformed message (prefix with no subsequent message)
// then just silently ignore it.
// TODO: The connections should be killed instead.
- if (msg_->flags () & msg_t::label) {
+ if (msg_->flags () & msg_t::more) {
more_out = true;
#include <zmq.hpp>
#include <stdio.h>
#include <stdint.h>
int main ()
{
zmq::context_t context (1);
zmq::socket_t s (context, ZMQ_DEALER);
uint64_t hwm = 1;
#include <zmq.hpp>
int main (int argc, char *argv [])
{
zmq::context_t context (1);
zmq::socket_t s (context, ZMQ_XREP);
s.connect ("tcp://127.0.0.1:11132");
for (int i = 0; i < 1000; i++)
{
#include <sp.h>
#include <assert.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int sock, rc;
struct sockaddr_sp addr;
char buffer [1024];
#include <xs.h>
#include <assert.h>
#include <stdio.h>
int main ()
{
void *ctx = xs_init ();
assert (ctx);
int rc = xs_plug (ctx, "/usr/local/lib/libfskeleton.so");
assert (rc == 0);
#include <xs.h>
#include <assert.h>
#include <unistd.h>
#include <string.h>
int main ()
{
int rc;
#include <stdmill.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct connection
{
struct tcpsocket s;
};