Code Monkey home page Code Monkey logo

restcomet's Introduction

PURPOSE:
  This small library provides an events interface using comets to your C++ programs.

USAGE:
  Client side-
    * You will POST to /EVENTS.LIST on the port you specified in the ctor in your server program
    * On first request, post a value 'events' with a pipe-seperated or colon-seperated list of GUID's representing your events.
    * When you get the request back, note the highest sequence value. You will use this value + 1 in your next request.
    * On all requests after the first one, you should specify your last known sequence with an http header X-RESTCOMET-SEQUENCE.
    * If a sequence is not specified, you will get all events that match your event mask that happen after your request.
    * The reason for the sequence is so that you do not miss events in between your POST requests.
    * Your events will show up as a MIME multipart response with 200 OK, where each component has a type of "application/restcomet-event"
    * Each event has the following format:
        S[NUM] G[STRING] T[NUM] L[NUM]
        DATADATADATADATA....
    * Where: S is the sequence, G is the GUID of the event, T is the timestamp (epoch), and L is the exact length of the data, in bytes 
In between the restcomet header and the data, is always on CRLF pair. This is not part of the L (length)
  Server side-
    * Come up with a list of well know GUID's and decide on an event format. Event data is opaque to this library;
      you can even use binary if you'd like, although I wouldn't recommend it (read the 'Art of UNIX Programming', it's fantastic)
    * In your program, grab an instance using the Instance() static method (restcomet is a singleton object)
    * Call the SubmitEvent method with a GUID and some data.

restcomet's People

Contributors

liquidweaver avatar

Stargazers

Mikhail avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.