GithubHelp home page GithubHelp logo

wagnandrv2 / tcp-eventbus-client-c-sharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaymine/tcp-eventbus-client-c-sharp

0.0 1.0 0.0 107 KB

vertx tcp eventbus client module for C#

License: MIT License

C# 94.74% Java 5.26%

tcp-eventbus-client-c-sharp's Introduction

TCP-eventbus-client-C~~#~~

This is a TCP eventbus implementation for C# clients. The protocol is quite simple:

Get from Nuget at

https://www.nuget.org/packages/VertxEventbus/1.2.0-beta

https://www.nuget.org/packages/vertx-eventbus/2.2.0-pre

  • 4bytes int32 message length (big endian encoding)

  • json string

  • built-in keys

      1) type: (String, required) One of "send", "publish", "register", "unregister".
      
      2) headers: (Object, optional) Headers with JSON format.
      
      3) body: (Object, optional) Message content in JSON format.
      
      4) address: (String, required) Destination address
      
      5) replyAddress: (String, optional) Address for replying to.
    

example:

        public class client
        {
            public static void Main(string[] args){
             
             io.vertx.Eventbus eb=new io.vertx.Eventbus();
            
             Headers h=new Headers();
             h.addHeaders("type","maths");
             
             //body
             JObject body=new JObject();
             body.Add("message","add");
             
             //sending with time out = 5 secs
             eb.send(
                 "pcs.status",//address
                 body,//body
                 "pcs.status",//reply address
                 h, //headers
                 (new ReplyHandlers("pcs.status",//replyhandler address
                    new Action<bool,string>( //replyhandler function
                        (err,message)=>{
                            Console.WriteLine("replyhandler:"+message);
                        }
                    )
                 )
                ),
                5);//timeout
          }
        }

tcp-eventbus-client-c-sharp's People

Contributors

jaymine avatar xapio-awagner avatar

Watchers

wagnandr_ 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.