您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

server-browser.js 640B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. const EventEmitter = require('events');
  3. class Server extends EventEmitter {
  4. constructor(options) {
  5. super();
  6. this.sockets = new Set();
  7. this.channels = new Map();
  8. this.mounts = [];
  9. }
  10. attach() {
  11. return this;
  12. }
  13. mount() {}
  14. async open() {}
  15. async close() {}
  16. join() {
  17. return true;
  18. }
  19. leave() {
  20. return true;
  21. }
  22. channel() {
  23. return null;
  24. }
  25. to() {}
  26. all() {}
  27. static attach(parent, options) {
  28. const server = new this(options);
  29. return server.attach(parent);
  30. }
  31. static createServer(options) {
  32. return new this(options);
  33. }
  34. }
  35. module.exports = Server;