echo $title; ?> </title> <meta name="description" content="<?php echo $description; ?> "/> <link rel="canonical" href="<?php echo $canonical; ?> " /> <?php if (publisher()) { ?> <link href="<?php echo publisher(); ?> " rel="publisher" /><?php } ?> <link href="//fonts.googleapis.com/css?family=Lato:300,400,300italic,400italic" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Crimson+Text:400,400italic" rel="stylesheet" type="text/css"> <!-- Global CSS --> <link rel="stylesheet" href="<?php echo site_url(); ?> themes/blog/css/bootstrap.min.css"> <!-- Plugins CSS --> <link rel="stylesheet" href="<?php
/* --------------------------------------------------------------------- * This is our server task * It publishes a time-stamped message to its pub socket every 1ms. */ function publisher() { $context = new ZMQContext(); // Prepare publisher $publisher = new ZMQSocket($context, ZMQ::SOCKET_PUB); $publisher->bind("tcp://*:5556"); while (true) { // Send current clock (msecs) to subscribers $publisher->send(microtime(true)); usleep(1000); // 1msec wait } } /* * This main thread simply starts a client, and a server, and then * waits for the client to croak. */ $pid = pcntl_fork(); if ($pid == 0) { publisher(); exit; } $pid = pcntl_fork(); if ($pid == 0) { subscriber(); exit; }