How to retrieve data require authorisation? VB.NET
I am planning to build our own bot using VB.NET. I have been succeeded to modify the code sample of C# to VB.NET and make it work.
I have established the connection, but facing issue in retrieving data that required authentication (Balance for example). I was successful to authorise using machine token, but when send 2nd request of retrieving Balance, I am getting no results.
I am wondering if I am missing anything here.
In other words, for the first request I am getting the response. But 2nd and later I am not getting responses.
I am using Async Tasks as per the sample code.
Answers
Hello. Can you show part of your source code?
Regards
Hi,
Thanks for the prompt reply.
Its based on the code sample provided in C#. I have created console application with 2 modules:
Module Main
Sub Main()
MainLoop()
End Sub
Function MainLoop() As Boolean
End Module
Imports System.Text
Imports System.Threading.Tasks
Imports System.Net.WebSockets
Imports System.Threading
Imports System.Net
Namespace BinaryWSDemo
Class BinaryWS
Private ws As New ClientWebSocket()
Private uri As New Uri("wss://ws.binaryws.com/websockets/v3")
End Class
End Namespace
Hello. That Class is not the best implementation for Binary Web Socket API. I recommed you to implement WebSocket4Net Library. Its very easy to use.
Regards
Thanks for the reply.
Can I find that class in NuGet ??
Yes of course.
Regards