.Net消息传递和STOMP协议 [英] .Net Messaging & STOMP Protocol

查看:112
本文介绍了.Net消息传递和STOMP协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对.net消息传递&它与其他开放协议的兼容性.我想知道.net消息传递API是否可以与STOMP协议一起使用?如何使用此协议?有需要使用的特定库吗?

I have a doubt regarding .net messaging & its compatibility with other open protocols out there. I would like to know if .net messaging API capable of working with STOMP protocol? How do i make use of this protocol? is there any specific library out there I need to use?

感谢您分享您的经验和想法.

thanks for sharing your experience and ideas.

推荐答案

从根本上讲,STOMP似乎是基于TCP的消息传递,带有其命令和控制字符集.

At the root of it, STOMP appears to be TCP-based messaging with its set of commands and control characters.

.NET中没有任何内容可以让您怀疑是否无法使用此协议来构建应用程序或库.如果要从头开始构建.NET STOMP库,则必须利用

There's nothing in .NET that should give you any doubts about not being able to build an application or library using this protocol. If you were building a .NET STOMP library from scratch, you'd have to leverage System.Net.Sockets. Here's some sample C# code.

Byte[] bytesSent = Encoding.ASCII.GetBytes(someStringMessage);

// Create a socket connection with the specified server and port.
Socket s = ConnectSocket("192.168.0.101", somePort);

// If the socket could not get a connection, then return false.
if (s == null)
    return false;

// Send message to the destination.
s.Send(bytesSent, bytesSent.Length, 0);

// Receive the response back
int bytes = 0;
s.ReceiveTimeout = 3000;
bytes = s.Receive(bytesReceived, bytesReceived.Length, 0);
string page = Encoding.ASCII.GetString(bytesReceived, 0, bytes);
s.Close();

您有什么疑问?也许有任何疑问都可以编辑您的问题?

What doubts did you have? Perhaps edit your question with any concerns?

这篇关于.Net消息传递和STOMP协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆