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

iOS: HTTPClient does not support timeouts

    Details

    • Sprint:
      2014 Sprint 12 SDK

      Description

      Save as app.js, run the following code with node app.js to start the server.

      Expected behaviout: the onerror callback is called.

      What happens: the onload callback is called.

      (function () {
       
        if (typeof process !== 'undefined') {
          require('http').createServer(function (req, res) {
            setTimeout(function () {
              res.end('Done');
            }, 3e3);
          }).listen(3000);
          console.log('Server listening to port 3000');
          return;
        }
       
        var client = Ti.Network.createHTTPClient({
          onload: function (e) {
            alert('Argh!');
          },
          onerror: function (e) {
            alert('Timeout worked (probably)');
          },
          timeout: 100  // in milliseconds
        });
       
        client.open('GET', 'http://localhost:3000');
       
        client.send();
       
      })();
      

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              yuchi Pier Paolo Ramon
              Reviewer:
              Sabil Rahim
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code