Getting data from websocket of stock that i did not enter in script
-
i am getting stock data from websocket that i did not subscribe in script. is it related to closing websocekt instance? i did not close my web socket instance in nodejs. @admin
-
Hi @91priyansh kindly let us know update of your above mentioned issue.
-
@admin my code
exports.watchStockPrice = async (data,socket) => {let web_socket = new WebSocket({ client_code: "DIYD85289", feed_token: initSmartApi.getApiCredentials().feedToken, }); const tokens = data.tokens; await web_socket.connect(); // web_socket.runScript(tokens,"mw"); //setTimeout(() =>{web_socket.close()},5000); web_socket.on('tick', (data) => { sendStockPrice(data,socket.id); });
}
function sendStockPrice(data,socketId) {
socketInit.getIO().to(socketId).emit("watchStockPrice",data);
}
-
Hi @91priyansh we have notice your issue kindly post you code snip or mail your piece of code @
api@angelbroking.com. to further assist you.