Wifi library - client.connect()

The error code I am getting when I try this sometimes is 0. The error codes listed are 1, -1, -2, -3 and -4 in the site https://www.arduino.cc/en/Reference/ClientConnect. Why am I getting 0?

thanks in advance for any help!

How about posting the code that you are using ?

UKHeliBob: How about posting the code that you are using ?

void StopCall()
{
 Serial.println();
 Serial.print("Call status - ");
 client.stop(); 
 /*Close any connection before a new request is sent to free the socket on the WiFi shield!
  * Any GET request, the server generates a response.
  * Until the response is read, this connection is open.
  * 4 connections at a time is the maximum!
  * Hence, close the connection just to be sure, by reading the response.
  */
 //client.connect(ip/url, port) - (SUCCESS = 1; TIMED_OUT = -1; INVALID_SERVER = -2; TRUNCATED = - 3; INVALID_RESPONSE = -4;)
 int callStatus = client.connect(server, 8085);

 switch (callStatus) 
 {
  case 1:Serial.println("Connection established with server!");
         //GET request for e-stop
         client.println("GET URL HTTP/1.1");
         client.println("Host: IP");
         client.println("Connection: close");
         client.println();

         Serial.println("Server response...");
         delay(serverResponseDelay);
         /*while(client.available()) //Print response
         {
          char c = client.read();
          Serial.print(c);
         }
         Serial.println();*/
         realizeJson();
         lastCallTime = millis();
         break;
  case -1:Serial.println("Timed out. Retrying!"); 
          break;
  case -2:Serial.println("Invalid server. Retrying!");
          break;
  case -3:Serial.println("Truncated response. Retrying!"); 
          break;
  case -4:Serial.println("Invalid response. Retrying!"); 
          break;
  default:Serial.print("Unknown! - Error Code: ");
          Serial.println(callStatus); 
          break;
 }
}

When I print callStatus when the code goes into the default case, I get an output as 0.

I am thinking it is because my WiFi had no signal. I am seeing that behavior when I switched off my WiFi connection. Earlier the connection might have been intermittent. Am I getting this right?