关于.net消息传递及其与其他开放协议的兼容性,我有一个疑问。 我想知道.net消息传递API是否能够与STOMP协议一起使用? 我该如何使用该协议? 是否有特定库需要使用?
感谢分享您的经验和想法。
关于.net消息传递及其与其他开放协议的兼容性,我有一个疑问。 我想知道.net消息传递API是否能够与STOMP协议一起使用? 我该如何使用该协议? 是否有特定库需要使用?
感谢分享您的经验和想法。
System.Net.Sockets
。以下是一些示例C#代码。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();