title: How can I reconnect a Photon Bolt client after it disconnects?
body: <p>I'm trying to make a Photon Bolt game that connects two devices. The problem is that the Client tends to get disconnected a lot, an it doesn't reconnect automatically. I've tried using methods like ReconnectAndRejoin, but it seems like it only works in PUN. Right now I'm using this custom solution, without success:</p>
  <pre><code>[BoltGlobalBehaviour(BoltNetworkModes.Client)]
  public class InitialiseGameClient : Photon.Bolt.GlobalEventListener
  {
      
      private bool disconnected;
  
      public void Update(){
  
          if(disconnected){
  
              Reconnect();
  
          }
  
      }
  
      public override void Disconnected(BoltConnection connection)
      {
  
          disconnected = true;
          
      }
      
  
  
      public void Reconnect(){
  
          BoltLauncher.StartClient();
          PlayerPrefs.DeleteAll();
  
          if (BoltNetwork.IsRunning &amp;&amp; BoltNetwork.IsClient)
          {
  
              foreach (var session in BoltNetwork.SessionList)
              {
                  UdpSession udpSession = session.Value as UdpSession;
  
                  if (udpSession.Source != UdpSessionSource.Photon)
                  continue;
  
                  PhotonSession photonSession = udpSession as PhotonSession;
  
                  string sessionDescription = String.Format(&quot;{0} / {1} ({2})&quot;,
                  photonSession.Source, photonSession.HostName, photonSession.Id);
  
                  RoomProtocolToken token = photonSession.GetProtocolToken() as RoomProtocolToken;
  
                  if (token != null)
                  {
                      sessionDescription += String.Format(&quot; :: {0}&quot;, token.ArbitraryData);
                  }
                  else
                  {
                      object value_t = -1;
                      object value_m = -1;
  
                      if (photonSession.Properties.ContainsKey(&quot;t&quot;))
                      {
                          value_t = photonSession.Properties[&quot;t&quot;];
  
                      }
  
                      if (photonSession.Properties.ContainsKey(&quot;m&quot;))
                      {
                          value_m = photonSession.Properties[&quot;m&quot;];
                      }
  
                      sessionDescription += String.Format(&quot; :: {0}/{1}&quot;, value_t, value_m);
                  }
  
                  ServerConnectToken connectToken = new ServerConnectToken
                  {
                      data = &quot;ConnectTokenData&quot;
                  };
  
                  Debug.Log((int)photonSession.Properties[&quot;t&quot;]);
  
                  var propertyID = PlayerPrefs.GetInt(&quot;PropertyID&quot;, 2);;
  
                  if((int)photonSession.Properties[&quot;t&quot;] == propertyID){
  
  
                      BoltMatchmaking.JoinSession(photonSession, connectToken);
                      disconnected = false;
  
                  }
              }
          }
          
  
      }
  }
  </code></pre>
  <p>With this method I'm trying to use the same code used to connect the the client for the first time in the reconnect function, and keep trying until the client manages to connect. However it seems that the code never executes, even if the disconnect function gets triggered (the reconnect doesn't). Is there any Bolt integrated function that helps with reconnecting? Thanks in advance.</p>