下面的代码似乎没有做任何事情。有取消订阅的方法吗?
var MTGOX = 'https://socketio.mtgox.com/mtgox';
var conn = io.connect(MTGOX);
conn.emit({
'channel':'d5f06780-30a8-4a48-a2f8-7ed181b4a13f',
'op':'mtgox.unsubscribe'
});发布于 2013-02-10 10:03:22
这里的示例:https://en.bitcoin.it/wiki/MtGox/API/Streaming#op:subscribe_and_op:unsubscribe仅将op名称显示为"unsubscribe“,而您使用的是"mtgox.unsubscribe”。你能试着去掉前缀吗,或者让我们知道你是从哪里得到这个前缀的?
发布于 2013-04-16 07:01:25
Socket.IO API响应“Mt.Gox”事件,因此您应该使用Socket.IO的send命令。
conn.send({
"channel": "d5f06780-30a8-4a48-a2f8-7ed181b4a13f",
"op": "unsubscribe"
});要取消订阅某个频道,请发送op " unsubscribe“。要订阅,请发送op "mtgox.subscribe“(as listed on the bitcoin.it wiki)。
这是另一种方法(为了澄清):
conn.emit('message', {
"channel": "d5f06780-30a8-4a48-a2f8-7ed181b4a13f",
"op": "unsubscribe"
});https://stackoverflow.com/questions/14793791
复制相似问题