MCPcopy
hub / github.com/nestjs/nest / close

Method close

packages/websockets/socket-module.ts:97–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 }
96
97 public async close(): Promise<any> {
98 if (!this.applicationConfig) {
99 return;
100 }
101 const adapter = this.applicationConfig.getIoAdapter();
102 if (!adapter) {
103 return;
104 }
105 const servers = this.socketsContainer.getAll();
106 await Promise.all(
107 iterate(servers.values())
108 .filter(({ server }) => server)
109 .map(async ({ server }) => adapter.close(server)),
110 );
111 await (adapter as AbstractWsAdapter)?.dispose();
112
113 this.socketsContainer.clear();
114 }
115
116 private initializeAdapter() {
117 const forceCloseConnections = (this.appOptions as NestApplicationOptions)

Callers

nothing calls this directly

Calls 6

getIoAdapterMethod · 0.80
allMethod · 0.80
closeMethod · 0.65
getAllMethod · 0.45
disposeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected