WebSocket4Net websocket.Send
in Binary Bot
Tell me what I'm doing wrong? This name does not exist in this context. Show me how to make a request correctly.
C#
class Program
{
public static void Main(string[] args) { using (WebSocket websocket = new WebSocket("wss://ws.binaryws.com/websockets/v3?app_id=xxx")) { websocket.Opened += new EventHandler(websocket_Opened); websocket.Closed += new EventHandler(websocket_Closed); websocket.MessageReceived += new EventHandler<MessageReceivedEventArgs>(websocket_MessageReceived); websocket.Open(); } }
Tagged:
Comments
First, are you using the "using WebSocket4Net;" directive on top?
Will Need to see the complete code In order to help.
Yes, of course, I attach my code below.
I looked at a lot of examples and wrote my own code from them, but I didn't fully understand how to use this library. Everything works well with WebSocket, but as I understand there are problems with It, so I do it on WebSocket4Net.
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using WebSocket4Net;
namespace Binary1
{
}
Hi @Fearnt, I recently had some problems connecting to the API, I was using the same package (WebSocket4Net) at the end I changed the package for another one and it worked, it looks like WebSocket4Net has some issues with TLS1.2.
Please take a look at the following post, you may find it useful,
https://binary.vanillacommunity.com/discussion/684/error-when-trying-to-connect-to-the-api-recent-api-changes#latest
Thanks for the link, but I found how to fix my problem)