I am using c# and trying to connect web socket on windows 10, also passed correct api key and access token, while connecting its showing the "Error while connecting. Message: Unable to connect to the remote server"
once "ticker.Connect();" this line is executed its control flow gets into "OnError" method with error message as "Error while connecting. Message: Unable to connect to the remote server", version is 3.0.0
Both the apikey and access token is correct but every time its showing this errors Error: Error while connecting. Message: Unable to connect to the remote server Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden. Closed ticker
i am simply executing this method provided in Zerodha reference code, the api key and access token passed is also correct but as soon as ticket.connect() is executed following errors pop up in console, version of library is 3.0.0 is there any step i am missing or forgot to do?
Error message Error: Error while connecting. Message: Unable to connect to the remote server Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden. Closed ticker
// Subscribing to NIFTY50 and setting mode to LTP ticker.Subscribe(Tokens: new UInt32[] { 256265 }); ticker.SetMode(Tokens: new UInt32[] { 256265 }, Mode: Constants.MODE_LTP); }
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
is there any step i am missing or forgot to do?
Error message
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
Code of a .net console app
static void Main(string[] args)
{
initTicker();
}
private static void initTicker()
{
ticker = new Ticker(//api key, // access token);
ticker.OnTick += OnTick;
ticker.OnReconnect += OnReconnect;
ticker.OnNoReconnect += OnNoReconnect;
ticker.OnError += OnError;
ticker.OnClose += OnClose;
ticker.OnConnect += OnConnect;
ticker.OnOrderUpdate += OnOrderUpdate;
ticker.EnableReconnect(Interval: 1, Retries: 1);
ticker.Connect();
// Subscribing to NIFTY50 and setting mode to LTP
ticker.Subscribe(Tokens: new UInt32[] { 256265 });
ticker.SetMode(Tokens: new UInt32[] { 256265 }, Mode: Constants.MODE_LTP);
}