Example #1
0
 /**
  * Returns the amount of seconds this request is able to be kept open without the client
  * closing it. This depends on the vendor.
  *
  * @access public
  * @return boolean
  */
 public static function GetExpectedConnectionTimeout()
 {
     // Different vendors implement different connection timeouts.
     // In order to optimize processing, we return a specific time for the major
     // classes currently known (feedback welcome).
     // The amount of time returned is somehow lower than the max timeout so we have
     // time for processing.
     if (!isset(self::$expectedConnectionTimeout)) {
         // Apple and Windows Phone have higher timeouts (4min = 240sec)
         if (stripos(SYNC_TIMEOUT_LONG_DEVICETYPES, self::GetDeviceType()) !== false) {
             self::$expectedConnectionTimeout = 210;
         } else {
             if (stripos(SYNC_TIMEOUT_MEDIUM_DEVICETYPES, self::GetDeviceType()) !== false) {
                 self::$expectedConnectionTimeout = 85;
             } else {
                 // for all other devices, a timeout of 30 seconds is expected
                 self::$expectedConnectionTimeout = 28;
             }
         }
     }
     return self::$expectedConnectionTimeout;
 }