GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Axios-Engineering/bits-node-ipc: Binding that allows the BITS message center to interact with external C/C++ programs.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
app/elements/node-ipc
app/elements/node-ipc
 
 
client
client
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

bits-node-ipc

This module used the node-ipc module to provide a binding between the BITS MessageCenter and external applications. This allows external processes to directly send and receive BITS events, requests, and responses.

Installation

git clone https://github.com/Axios-Engineering/bits-node-ipc.git
cd bits-node-ipc
npm install
ln -s $PWD $BITS_HOME/data/base/modules/modules/bits-node-ipc

C++ Client

The client folder contains an example C++11 application and the MesageCenter header file.

First you include the MessageCenter header file and construct a MessageCenter object. The bits-node-ipc module creates a Unix Domain Socket at /tmp/bits.systemid.

#include "MessageCenter.h"

MessageCenter messageCenter("/tmp/bits.systemid");

Requests are sent via the sendRequest() method:

json response = messageCenter.sendRequest("base#System bitsId");
std::string systemId = response[0];

Events are sent with the sendEvent() method:

messageCenter.sendEvent("bits-ipc#Client connected");

Request and Event Listeners are also supported:

void onHeartbeat(const json &msg) {
    cout << "Received Heartbeat" << msg << endl;
}

json handlePing(const json &ping) {
    cout << "Received PING" << ping << endl;
    json resp;
    resp["pong"] = std::time(0)*1000;

    return resp;
}

// handle the 'heartbeat' message
messageCenter.addEventListener("bits-ipc#heartbeat", onHeartbeat);

// handle 'ping' request
messageCenter.addRequestListener("bits-ipc#ping", handlePing);

About

Binding that allows the BITS message center to interact with external C/C++ programs.

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

3 stars

Watchers

5 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.