【问题标题】:How to send a command when connecting started in WampSharp在 WampSharp 中开始连接时如何发送命令
【发布时间】:2017-11-06 11:54:08
【问题描述】:

我遇到了这个问题Can't connect to Poloniex .我想我找到了solution。我需要在打开连接时发送命令。像这样。

from websocket import create_connection
import json

ws = create_connection("wss://api2.poloniex.com:443")
ws.send('{"command" : "subscribe", "channel" : 1001}')

while True:
    result = ws.recv()
    json_result = json.loads(result)
    if len(json_result) >= 3:
        print(json_result)

ws.close()

但它为 Python 编码。我怎样才能在 WampSharp 中做到这一点?

【问题讨论】:

    标签: c# wampsharp


    【解决方案1】:

    WampSharp 是一个用于 WAMP 协议的库。您附加的代码不使用 WAMP 协议,而是使用不同的自定义 WebSocket 子协议。因此,无法使用 WAMP 库使用此服务。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-01
      • 2012-11-25
      • 1970-01-01
      • 1970-01-01
      • 2020-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多