【发布时间】:2016-07-23 00:57:10
【问题描述】:
这是我使用最新预发布版 WampSharp 的非常简单的代码:
var channelFactory = new DefaultWampChannelFactory();
var channel = channelFactory.CreateMsgpackChannel("wss://api.poloniex.com", "realm1");
await channel.Open();
var realmProxy = channel.RealmProxy;
Console.WriteLine("Connection established");
int received = 0;
IDisposable subscription = null;
subscription =
realmProxy.Services.GetSubject("ticker")
.Subscribe(x =>
{
Console.WriteLine("Got Event: " + x);
received++;
if (received > 5)
{
Console.WriteLine("Closing ..");
subscription.Dispose();
}
});
Console.ReadLine();
虽然不起作用,订阅中的代码永远不会运行。用CreateJsonChannel也试过了,也没用。
有什么想法可能是错的吗?
【问题讨论】:
-
我正在尝试使用 poloniex websocket api。你有工作示例代码吗?
-
你解决了吗?
-
这是他们的 API,而不是你的代码。他们的 API 没有发送数据。我用发布的 node.js 示例进行了尝试,也没有数据返回。