0
我試過每個可能的URI組合,下面是我的代碼。當使用網頁http://www.websocket.org/echo.html和「位置:」輸入ws://websocket.mtgox.com/mtgox時,網頁會顯示流的良好提要。但是,當我複製並粘貼下面的示例,並使用相同的URI流,我得到「錯誤:未定義」和「斷開連接」。我試過把這個轉換爲VB,按照下面的例子,沒有運氣。任何關於我在做什麼的想法都是錯誤的?無法連接到MtGox Websocket
進口WebSocket4Net
模塊模塊1
Sub Main()
Dim websocket As New WebSocket4Net.WebSocket("ws://websocket.mtgox.com:80/mtgox")
Dim stream As String
Console.WriteLine(websocket.State)
Console.ReadKey()
AddHandler websocket.Opened, Sub(s, e) socketOpened()
AddHandler websocket.Error, Sub(s, e) socketError()
AddHandler websocket.Closed, Sub(s, e) socketClosed()
AddHandler websocket.MessageReceived, Sub(s, e) socketMessage()
AddHandler websocket.DataReceived, Sub(s, e) socketDataReceived()
websocket.Open()
Console.ReadKey()
End Sub
Sub socketOpened()
MsgBox("Opened")
End Sub
Sub socketClosed()
MsgBox("Closed")
End Sub
Sub socketError()
MsgBox("Error")
End Sub
Sub socketMessage()
'MsgBox(e)
End Sub
Sub socketDataReceived()
MsgBox("Data received")
End Sub
前端模塊