ZMQContexted getSocket trhow connection reset error

Viewed 198

I have followed this tutorial to build a real-time notification system http://socketo.me/docs/push and all works good. I get a new connection to the server but my problem is that I cant send my new entry data with the zeromqContext so I can rebroadcast to my users

Here is my push-server.php thats works fine and I can see the new connection in the terminal

DIR) . '/vendor/autoload.php';

$loop   = React\EventLoop\Factory::create();
$pusher = new MyApp\Pusher;

// Listen for the web server to make a ZeroMQ push after an ajax request
$context = new React\ZMQ\Context($loop);
$pull = $context->getSocket(ZMQ::SOCKET_PULL);
$pull->bind('tcp://127.0.0.1:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
$pull->on('message', array($pusher, 'onBlogEntry'));

// Set up our WebSocket server for clients wanting real-time updates
$webSock = new React\Socket\Server('0.0.0.0:8082', $loop); // Binding to 0.0.0.0 means remotes can connect
$webServer = new Ratchet\Server\IoServer(
    new Ratchet\Http\HttpServer(
        new Ratchet\WebSocket\WsServer(
            new Ratchet\Wamp\WampServer(
                $pusher
            )
        )
    ),
    $webSock
);

$loop->run();

I connect in my server with this piece of code

<script>
    var conn = new ab.Session('ws://localhost:8082',
        function() {
            conn.subscribe('kittensCategory', function(topic, data) {
                // This is where you would add the new article to the DOM (beyond the scope of this tutorial)
                console.log('New article published to category "' + topic + '" : ' + data.title);
            });
        },
        function() {
            console.warn('WebSocket connection closed');
        },
        {'skipSubprotocolCheck': true}
    );
</script>

and my problem is that when I make an ajax POST request and store something in the database and then run these 3 commands


$context = new ZMQContext();
$socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
$socket->connect("tcp://localhost:5555");

my apache server throws me a net::ERR_CONNECTION_RESET and it is restarting. I have seen in the error log these stuff

[Wed Jun 26 14:16:47.434928 2019] [mpm_winnt:notice] [pid 9768:tid 564] AH00428: Parent: child process 1216 exited with status 3221225725 -- Restarting. [Wed Jun 26 14:16:47.482972 2019] [ssl:warn] [pid 9768:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Wed Jun 26 14:16:47.515009 2019] [mpm_winnt:notice] [pid 9768:tid 564] AH00455: Apache/2.4.39 (Win64) OpenSSL/1.1.1c PHP/7.2.19 configured -- resuming normal operations [Wed Jun 26 14:16:47.515009 2019] [mpm_winnt:notice] [pid 9768:tid 564] AH00456: Apache Lounge VC15 Server built: May 29 2019 11:22:50

I searched the status code and I updated my httpd.conf file with the ThreadStackSize 888888 but I get the same error.

0 Answers
Related