GithubHelp home page GithubHelp logo

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

Stargazers

Nick avatar SilverFox avatar Ricardo Pacheco avatar 小区的画墙充满了童趣 avatar Richard G. avatar

Watchers

James Cloos avatar  avatar the-voice avatar

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

version

Hi,
thanks for your work.
I will try the eventbus, but I dont`t know which version I should use.
Can you give me a hint, which version is most stable?

best regards

Feature Request

Hi Would it be possible for you to be able to adapt the code to connect to the sockjs bridge presented by vertx web?

  1. Setup Vertx web.
  2. Enable the socks bridge as per the documentation.
  3. Connect your code to the raw web socket instead of to a TCP socket.
    e.g. ws://localhost:80/eventbus/websocket
    in the example eventbus can be anything. Basically the sockjs handler exposes a web socket that we can connect to directly and send messages over to the vertex event bus on the server.

This will mean one server exposing a single socket for web apps using sockJS client as well as any other connecting application e.g. .net using your code.

thanks.

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.