我想實時從Poloniex中檢索報價。他們使用wamp。我通過金塊WampSharp安裝,發現這個代碼:HTTP 502錯誤的網關C#與poloniex上的瓦爾
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();
}
但在伺機channel.open不管()我有以下錯誤:HHTP 502網關
你有一個想法,哪裏是問題
預先感謝您
你解決了這個問題嗎? –
你可以試試這個要點。 https://gist.github.com/darkl/bc545b04c8d557246ef34eb4d7e8baea – darkl
謝謝你的作品,你會添加一個答案,或者我應該把它自己的線程? – ronki