File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import { Namespace } from "./namespace" ;
2- import type { Server } from "./index" ;
2+ import type { Server , RemoteSocket } from "./index" ;
33import type {
44 EventParams ,
55 EventNames ,
@@ -64,4 +64,13 @@ export class ParentNamespace<
6464 this . server . _nsps . set ( name , namespace ) ;
6565 return namespace ;
6666 }
67+
68+ fetchSockets ( ) : Promise < RemoteSocket < EmitEvents > [ ] > {
69+ // note: we could make the fetchSockets() method work for dynamic namespaces created with a regex (by sending the
70+ // regex to the other Socket.IO servers, and returning the sockets of each matching namespace for example), but
71+ // the behavior for namespaces created with a function is less clear
72+ // note²: we cannot loop over each children namespace, because with multiple Socket.IO servers, a given namespace
73+ // may exist on one node but not exist on another (since it is created upon client connection)
74+ throw new Error ( "fetchSockets() is not supported on parent namespaces" ) ;
75+ }
6776}
You can’t perform that action at this time.
0 commit comments