Open source libraries that implement the WebSocket and Wamp protocols Wampsharp

Source: Internet
Author: User

Websocket Application Messaging Protocol protocol: Https://github.com/wamp-proto/wamp-proto

1. Basic Archives

Introduced:

The WAMP protocol is a communication protocol that can be publish&subscribe and RPC based on WebSocket. It realizes the pub&sub communication pattern similar to the ZEROMQ, and uses this mode for the traditional RPC communication, which is a good way to decouple the direct connection between the communication endpoints.

Basic concepts:

Broker:pub&sub the middleware in communication mode.

Middleware for Caller&callee communication in DEALER:RPC.

Router:router is actually a combination of broker and dealer.

Realm:realm is an activity space in the router, and the communication between the clients takes realm as the active interval.

Client: The communication entity, the message Publisher/subscriber, the interface caller/the provider.

Peer:client or router.

The role played by Role:peer.

Topic:pub&sub theme, expressed in URI format.

The interface address of the PROCEDURE:RPC is also expressed using the URI format.

Communication model:

(This picture of specification shows everything)

Https://github.com/Code-Sharp/WampSharp implements the WebSocket Protocol and the WebSocket application Messaging Protocol (WAMP) Association On.

Characteristics:

    • Supports WebSocket RFC6455 and Wamp v1/v2
    • Very good to meet the standard
    • High-performance asynchronous design
    • Easy-to-use API
Client Side

ComponentsThe concept is that the component is the calling and callee of the RPC, or the Publisher and subscriber of the PubSub, and the four roles are components, in which case the code is applied. RPC model

3 characters, Caller CalleeDealer

    • Caller(caller) Invokes the remote interface using the URL and parameters, Callee gets the parameters to execute, and returns the result
    • CalleeFirst the call is registered to, Dealer Caller the call first to Dealer , the Dealer call will be Caller routed to the corresponding Callee , and then the Callee result is returned to Caller .
    • CallerAnd Callee will run the application code, Dealer will do rpc generic route.

The RPC model has a two-step process, which registers the program and invokes the program.

Now the problem is, I wrote the RPC program, how to register to router inside it? Is it auto-generated in wampsharp, or do you want to change the configuration file manually?

In fact, are not, are by the components themselves to register, other componets to use their own. The specific operation is similar to the callee program connection crossbar, and then register their own to provide others with the API, and then Caller connect Router Crossbario Calling program, if the Callee line is dropped, then it will Caller not be called. PubSub model

There are 3 characters Publisher , SubscriberBroker

Publiser(publisher) provides a URL and corresponding payload that Subscribers subscribers can receive information about the publisher. Brokeris to provide a place to publish and subscribe. Similar to the publish-subscribe pattern provided in most of our message queues.

Summarize:

The router introduced by Wamp can seamlessly update the backend interface, and realm allows the backend interface to expose only a subset of functionality to the front end. Pub&sub also makes it easy to multicast messages.

Open source libraries that implement the WebSocket and Wamp protocols Wampsharp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.