You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
712 B

4 years ago
  1. 'use strict';
  2. var inherits = require('inherits')
  3. , AjaxBasedTransport = require('./lib/ajax-based')
  4. , XdrStreamingTransport = require('./xdr-streaming')
  5. , XhrReceiver = require('./receiver/xhr')
  6. , XDRObject = require('./sender/xdr')
  7. ;
  8. function XdrPollingTransport(transUrl) {
  9. if (!XDRObject.enabled) {
  10. throw new Error('Transport created when disabled');
  11. }
  12. AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject);
  13. }
  14. inherits(XdrPollingTransport, AjaxBasedTransport);
  15. XdrPollingTransport.enabled = XdrStreamingTransport.enabled;
  16. XdrPollingTransport.transportName = 'xdr-polling';
  17. XdrPollingTransport.roundTrips = 2; // preflight, ajax
  18. module.exports = XdrPollingTransport;