场景:一旦 Node.js 服务器有 ZeroMQ 拉监听tcp://127.0.0.1:2202
。并且数据必须由 C# 控制台应用程序发送。
问题:
示例参考
using System;
using System.Text;
using ZMQ;
namespace ZMQGuide
{
class Program
{
static void Main(string[] args)
{
// ZMQ Context and client socket
using (ZmqContext context = ZmqContext.Create())
using (ZmqSocket client = context.CreateSocket(SocketType.PUSH))
{
client.Connect("tcp://127.0.0.1:2202");
string request = "Hello";
for (int requestNum = 0; requestNum < 10; requestNum++)
{
Console.WriteLine("Sending request {0}...", requestNum);
client.Send(request, Encoding.Unicode);
string reply = client.Receive(Encoding.Unicode);
Console.WriteLine("Received reply {0}: {1}", requestNum, reply);
}
}
}
}
}
是给出以下错误:
Error 1 The type or namespace name 'ZmqContext' could not be found (are you missing a using directive or an assembly reference?) D:\..\Program.cs 26 24 PROJECTA
信息:我尝试使用包管理器控制台安装最新版本,方法是PM> Install-Package clrzmq
在命令后发出命令输出:
'clrzmq 2.2.5' already installed.
Successfully added 'clrzmq 2.2.5' to PROJECTA.
问题:谁能告诉我,我哪里出错了或者我错过了什么?
更新:我已经下载并尝试过,但没有运气:-)
提前感谢您的大力帮助