Network connect reconnection

hi,
I would make sure that the client continuously try to connect to the server until it succeeds.
This code works, but only if the ControlConnected() is called in the Start() function.
in the Update() does not work.
I also tried to use a one-second interval between connection attempts without success.

var ip="192.168.1.1";
var Host="Yes";

var connected=false;

 function Start(){

 Server();

 ControlConnected();
 
    }

 function Update() {
  //ControlConnected();
   
    }

 function ControlConnected(){

   if (connected==false) Network.Connect(ip, 5300);
    
    }

 function Server()
    {        
         if (Host=="Yes") Network.InitializeServer(10, 5300, false);                                      
    }
       
    function OnConnectedToServer() {
    connected=true;
    }

solved!
instead of using update I used a very long timeout.

var ip="192.168.1.1";
var Host="Yes";
var seconds=60;
 
var connected=false;
 
 function Start(){
 
 Server();
 
 ControlConnected();
 
    }
 

  function ControlConnected(){
    
    for (i=0;i<seconds;i++){
    yield WaitForSeconds(1);

   if (connected==false)  {
  Network.Connect(ip, 5300);
  }
 
 function Server()
    {        
         if (Host=="Yes") Network.InitializeServer(10, 5300, false);                                      
    }
 
    function OnConnectedToServer() {
    connected=true;
    }