connectionstate.js 607 B

12345678910111213141516171819202122232425262728
  1. /*!
  2. * Connection states
  3. */
  4. var STATES = module.exports = exports = Object.create(null);
  5. var disconnected = 'disconnected';
  6. var connected = 'connected';
  7. var connecting = 'connecting';
  8. var disconnecting = 'disconnecting';
  9. var unauthorized = 'unauthorized';
  10. var uninitialized = 'uninitialized';
  11. STATES[0] = disconnected;
  12. STATES[1] = connected;
  13. STATES[2] = connecting;
  14. STATES[3] = disconnecting;
  15. STATES[4] = unauthorized;
  16. STATES[99] = uninitialized;
  17. STATES[disconnected] = 0;
  18. STATES[connected] = 1;
  19. STATES[connecting] = 2;
  20. STATES[disconnecting] = 3;
  21. STATES[unauthorized] = 4;
  22. STATES[uninitialized] = 99;