locked
SignalR doesn't Reconnect in Unity3D Client RRS feed

  • Question

  • User-1965013001 posted

    i cant find any sample for this subject.

    anyway,  In my Client Side (Unity3d) , when my connection is Closed , Reconect Event doesnt fire.

    what can we do ?

    Monday, March 19, 2018 5:16 PM

All replies

  • User61956409 posted

    Hi Vergilooos,

    Vergilooos

    In my Client Side (Unity3d) , when my connection is Closed , Reconect Event doesnt fire.

    Do you call the Stop method on client side to end the SignalR connection? If you’d like to make it to reconnect to the hub server, you can try to set a timer to wait a period of time and then call the Start method to establish a new connection after the client disconnected.

    With Regards,

    Fei Han

    Tuesday, March 20, 2018 7:49 AM
  • User-1965013001 posted

    Hi
    Tnx Fei Han,

    Do you call the Stop method on client side to end the SignalR connection?

    when i say "my connection is closed", i mean i lost my internet (turned off Wifi), so , how can i call stop method? when there is no connection between server and client .

    you can try to set a timer to wait a period of time and then call the Start method to establish a new connection after the client disconnected.

    yes! i try this way, but there is a big problem:
    when i call Start Method without connection between server and client, the Start Method doesnt Work fine, it's like an infinite loop, so i cant call this method again...

    Sunday, March 25, 2018 12:33 PM
  • User61956409 posted

    Hi Vergilooos,

    when i say "my connection is closed", i mean i lost my internet (turned off Wifi)

    If you turn off the wifi for a long time, hub server detect the client is not active, the connection will be stopped, and it will not reconnect automatically. The new connection will be established when the client application starts.    

    With Regards,

    Fei Han

    Thursday, April 5, 2018 4:45 AM