File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { Namespace } from "./namespace" ;
2
- import type { Server } from "./index" ;
2
+ import type { Server , RemoteSocket } from "./index" ;
3
3
import type {
4
4
EventParams ,
5
5
EventNames ,
@@ -64,4 +64,13 @@ export class ParentNamespace<
64
64
this . server . _nsps . set ( name , namespace ) ;
65
65
return namespace ;
66
66
}
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
+ }
67
76
}
You can’t perform that action at this time.
0 commit comments