Send and Receive JSON with Websocket4NET on

Apr 28, 2016 at 2:42 AM
Hi there,

I am new with websocket/json and i have sample code to send and receive data from websocket with as per below

Public Class Form1
Private websocket As WebSocket4Net.WebSocket

Private Sub Button1_Click(sender As Object, ev As EventArgs) Handles Button1.Click
    websocket = New WebSocket4Net.WebSocket("wss://")
    AddHandler websocket.Opened, Sub(s, e) socketOpened(s, e)
    AddHandler websocket.Error, Sub(s, e) socketError(s, e)
    AddHandler websocket.Closed, Sub(s, e) socketClosed(s, e)
    AddHandler websocket.MessageReceived, Sub(s, e) socketMessage(s, e)
    AddHandler websocket.DataReceived, Sub(s, e) socketDataReceived(s, e)
End Sub

Sub socketOpened(s As Object, e As EventArgs)
End Sub

Sub socketClosed(s As Object, e As EventArgs)

End Sub

Sub socketError(s As Object, e As SuperSocket.ClientEngine.ErrorEventArgs)

End Sub

Sub socketMessage(s As Object, e As WebSocket4Net.MessageReceivedEventArgs)
End Sub

Sub socketDataReceived(ss As Object, e As WebSocket4Net.DataReceivedEventArgs)

End Sub
End Class

And I want to receive the data and store in datagridview, is there anyone can help me with the code, thanks.


attached is message received from above code..