src/zeromq.c
/*
 *
 * ZeroMQ Publisher socket: forward all Redis PUBLISH'es to ZeroMQ
 *
 */
ZeroMQ Publisher socket: forward all Redis PUBLISH'es to ZeroMQ
ZeroMQ Publisher socket : forward all Redis PUBLISH ' es to ZeroMQ
static void zeroMqSetupPublisher (void) {
  int rc;
  if (server.zeromq_publish_bind == NULL) return;
  publish_sock = zmq_socket(context, ZMQ_PUB);
  if (publish_sock == NULL) {
    int err = zmq_errno();
    redisLog(REDIS_WARNING, "Failed to create the publisher socket: (%d) %s", err, zmq_strerror(err));
    return;
  }
  rc = zmq_bind(publish_sock, server.zeromq_publish_bind);
  if (rc == -1) {
    int err = zmq_errno();
    redisLog(REDIS_WARNING, "Failed to create the publisher socket: (%d) %s", err, zmq_strerror(err));
    zmq_close(publish_sock);
    publish_sock = NULL;
    return;
  }
  redisLog(REDIS_NOTICE, "ZeroMQ publisher socket listening at %s", server.zeromq_publish_bind);
}
static void zeroMqSetupPublisher ( void ) { int rc ; if ( server . zeromq_publish_bind == NULL ) return ; publish_sock = zmq_socket ( context , ZMQ_PUB ) ; if ( publish_sock == NULL ) { int err = zmq_errno ( ) ; redisLog ( REDIS_WARNING , " " , err , zmq_strerror ( err ) ) ; return ; } rc = zmq_bind ( publish_sock , server . zeromq_publish_bind ) ; if ( rc == -1 ) { int err = zmq_errno ( ) ; redisLog ( REDIS_WARNING , " " , err , zmq_strerror ( err ) ) ; zmq_close ( publish_sock ) ; publish_sock = NULL ; return ; } redisLog ( REDIS_NOTICE , " " , server . zeromq_publish_bind ) ; }
ZeroMQ Publisher socket: forward all Redis PUBLISH'es to ZeroMQ
ZeroMQ Publisher socket : forward all Redis PUBLISH ' es to ZeroMQ