Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11260

Android: client.setTimeout does not work.

    Details

      Description

      the timeout can be set in the below ways:

      client.timeout=timeOut; 
      client.setTimeout(timeOut); 
      var client = Titanium.Network.createHTTPClient({timeout=timeOut});
      

      But it only works when its set as client.timeout=timeOut;

      Steps to reproduce:

      In the below code If you can replace with any of the above three it should work the same but it does not.

      var win = Ti.UI.createWindow({
      	backgroundColor : 'pink'
      });
      win.open();
       
      var postData = '{"email":"vaibhav.mundale@zeonsolutions.com","password_hash":"1234567","deviceUId":"14913af4-025c-e301-239b-1ba1-400e491f50a9","password":"1234567","store_id":"5"}';
       
      var timeOut = 1500;
      var client = Titanium.Network.createHTTPClient({timeout:timeOut});
      if(Ti.Platform.osname !== 'android')
         client.tlsVersion = Titanium.Network.TLS_VERSION_1_1;
      client.open('POST', 'http://173.227.201.16/BradyMobile/Login');
      client.setRequestHeader("Content-Type", "text/json");
      client.onload = function() 
      {
          alert('Status load:' + this.status +':'+ this.responseText);
      }
      client.onerror = function(e) 
      {
          alert('Status error:' + this.status +':'+ this.responseText);
      };
      client.send(postData);
      

      1. Run this code
      Expected behavior: error alert pops up, timeout exception in log
      Actual behavior: nothing happens

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              aakkinepally Amuktha Akkinepally
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-14533
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration