【发布时间】:2017-09-13 10:26:38
【问题描述】:
我想从 Poloniex 实时检索报价。他们为此使用 wamp。我通过 nugget WampSharp 安装并找到了这段代码:
static async void MainAsync(string[] args)
{
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();
}
但是不管在 await channel.open() 我有以下错误:HHTP 502 bad gateway
你知道问题出在哪里
提前谢谢你
【问题讨论】:
-
你解决了吗?
-
谢谢它的工作,你会添加一个答案还是我自己把它放在线程上?
标签: c# wamp-protocol poloniex