Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaymine/TCP-eventbus-client-C-Sharp
vertx tcp eventbus client module for C#
https://github.com/jaymine/TCP-eventbus-client-C-Sharp
Last synced: 2 months ago
JSON representation
vertx tcp eventbus client module for C#
- Host: GitHub
- URL: https://github.com/jaymine/TCP-eventbus-client-C-Sharp
- Owner: jaymine
- License: mit
- Created: 2016-06-22T19:24:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-16T04:05:39.000Z (about 8 years ago)
- Last Synced: 2024-11-03T15:07:48.539Z (3 months ago)
- Language: C#
- Homepage:
- Size: 104 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- vertx-awesome - C# - Event bus client for C# using the [TCP-based protocol](https://github.com/vert-x3/vertx-tcp-eventbus-bridge). (Vert.x Event Bus Clients)
README
# 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:
```cs
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( //replyhandler function
(err,message)=>{
Console.WriteLine("replyhandler:"+message);
}
)
)
),
5);//timeout
}
}
```