Giter Site home page Giter Site logo

paintbahn's Introduction

https://wamp-proto.org/implementations.html		// supported by all languages

Run WAMP server Thruway as:  		php vendor/voryx/thruway/Examples/SimpleWsRouter.php	 From root dir. Change IP as current available in this file: vendor\voryx\thruway\Examples\SimpleWsRouter.php

1. PaintBahnApp is HTNL5 canvas base dwring client app, so run it on a httpd server
 
2. Run php WAMP Autobahn Client as: 		php client\Client.php 				 From root dir
3. AutobahnJS is JS client run in browser, run it on web server
Now both client are ready to communicate with each others.
like run this line in script shell

connection.session.call('com.myapp.add2', [45,42]).then(function(su){console.log('result:',su)},function(er){console.log("Error ocaures",er)});


https://github.com/crossbario/autobahn-js/blob/master/doc/reference.md

Use wampc node global package to test WAMP Router as :  
$ wampc ws://localhost:9090/ws realm1		// This will first create a connection variable and by that connection establish a session
=>Pub/Sub
Now subscribe one or more client as
$ session.subscribe('test',function(e){console.log("hello",e)});
Now publis a message on a chennal as
$ session.publish('test',["Hello to all"]);

=>Callee/Caller
First Register a callee to Deilar as

    function utcnow() {
        console.log("Someone is calling com.myapp.date");
        now = new Date();
        return now.toISOString();
    }

    session.register('com.myapp.date', utcnow).then(
        function (registration) {
            console.log("Procedure registered:", registration.id);
        },
        function (error) {
            console.log("Registration failed:", error);
        }
    );

Now Call to Callee as
session.call('com.myapp.date');


NOTE: Thruway is based on Ratchet PHP framework, which is non-blocking event-loop server

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.