Web Socket: Is not returning anything


  • 	private void btnAngelOneLogin_Click(object sender, EventArgs e)
    	{
    
    	AngelOne = new SmartApi(API_KEY_ANGELONE);
    
    	string totp = GetTotp(TOTP_QR_KEY_ANGELONE);
    
    	OutputBaseClass obj = new OutputBaseClass();
    	obj = AngelOne.GenerateSession(CLIENT_CODE_ANGELONE, MPIN_ANGELONE, totp);
    	AngelToken sagr = obj.TokenResponse;
    
    	if (obj.status == false)
    	{
    		string http_code = obj.http_code;
    		string http_error = obj.http_error;
    
    		return;
    	}
    
    
    	WebSocket _WS = new WebSocket();
    	var exitEvent = new ManualResetEvent(false);
    
    	_WS.ConnectforStockQuote(sagr.feedToken, CLIENT_CODE_ANGELONE);
    	if (_WS.IsConnected())
    	{
    		string script = "nse_cm|2885&nse_cm|1594&nse_cm|11536&nse_cm|3045";
    		_WS.RunScript(sagr.feedToken, CLIENT_CODE_ANGELONE, script, "mw");
    		_WS.MessageReceived += WriteResult;
    
    
    		//_WS.Close(true);// to stop and close socket connection
    	}
    	exitEvent.WaitOne();
    
    	}
    
    	static void WriteResult(object sender, MessageEventArgs e)
    	{
    	    Console.WriteLine("Tick Received : " + e.Message);
    	}
    }
    

    I am calling this from Winform application, not getting any call backs.
    It just stays at this code, exitEvent.WaitOne();

    Anyhelp will be great.