Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:17:44+00:00 2026-06-13T22:17:44+00:00

Basically, I want to inform a C++ application (a game application) when an event

  • 0

Basically, I want to inform a C++ application (a game application) when an event occurs in my PHP page.

Below is an example:

  • User logs in to website and purchases something.
  • PHP validates this transaction and returns a JSON/XML object to C++ application.
  • C++ application receives transactionID and gives user the item he bought.

Right now I do this in a bad way. PHP writes to database, C++ application constantly reads the database, causing a performance loss.

How can I archieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:17:45+00:00Added an answer on June 13, 2026 at 10:17 pm

    Use ZeroMQ supports both PHP and C++;

    Simple hello World Example

    //
    //  Hello World server in C++
    //  Binds REP socket to tcp://*:5555
    //  Expects "Hello" from client, replies with "World"
    //
    #include <zmq.hpp>
    #include <string>
    #include <iostream>
    #include <unistd.h>
    
    int main () {
        //  Prepare our context and socket
        zmq::context_t context (1);
        zmq::socket_t socket (context, ZMQ_REP);
        socket.bind ("tcp://*:5555");
    
        while (true) {
            zmq::message_t request;
    
            //  Wait for next request from client
            socket.recv (&request);
            std::cout << "Received Hello" << std::endl;
    
            //  Do some 'work'
            sleep (1);
    
            //  Send reply back to client
            zmq::message_t reply (5);
            memcpy ((void *) reply.data (), "World", 5);
            socket.send (reply);
        }
        return 0;
    }
    

    PHP

    $context = new ZMQContext();
    $requester = new ZMQSocket($context, ZMQ::SOCKET_REQ);
    $requester->connect("tcp://localhost:5555");
    
    //Send Simple Request
    $requester->send("Hello");
    
    //Get Response Form C++
    printf("Received reply %s", $requester->recv());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically want to autodetect a user's timezone using Rails. I can use this
I basically want to write a customer logger/tracer which also logs the class and
I basically want to dynamically apply some style to all elements in a page,
I basically want to make this in my application, so our technicians have an
What I basically want to accomplish is that when a user edits his profile,
I am designing an application where I basically want to load geographical maps that
I basically want to display a tooltip when someone first reaches the page, but
I basically want to make a clone of the classic game Pacman using Python.
Basically i want to be able to allow the user to save bookmarks which
I basically want to do this: grep 'example.com' www_log > example.com.YYYY-MM-DD-H:i:S.log ...with of course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.