DVLP / signalr-no-jquery

120 stars 78 forks source link

how to use disconnect or state changed method using this plugin. #33

Closed SuryaThrideep closed 5 years ago

SuryaThrideep commented 7 years ago

i am using this plugin in both android and ios . android working fine but in ios if leave the app in idle state for 5-10 mins . some thing going wrong. client event not firing . if i got disconnect or state change event for signalr if the connection lost i will make the connection start in the call if that was issue please help me in finding the event asap. thank you.

marlonbrgomes commented 6 years ago

Looking into the source code I found a stop method inside of the transporter that allows the manual disconnect from signalR.

And you can just dispatch it from any place of your code. It will interrupt the polling.

import { connection } from 'signalr-no-jquery';
connection.stop();
sirhcybe commented 6 years ago

@marlonbrgomes I think the OP's issue wasn't very clear but by reading it closely I think they are experiencing the same issue I am. I am seeing my http connections close on the client after being open for no reason and I'm not sure why yet. I am running a sample app that uses the standard SignalR lib (with jQuery) side-by-side with my Angular app that uses signalr-no-jquery and the connection to the Angular app drops while the connection to the sample app stays open.