这是我使用WampSharp的最新预发布版本非常简单的代码:WampSharp无法连接到Poloniex?
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。你有没有工作示例代码? – Luther
你解决了吗? –
这是他们的API,而不是你的代码。他们的API不发送数据。我试着用发布的node.js例子,也没有数据返回。 – Simoyd