()
| 114 | } |
| 115 | |
| 116 | private initializeAdapter() { |
| 117 | const forceCloseConnections = (this.appOptions as NestApplicationOptions) |
| 118 | .forceCloseConnections; |
| 119 | const adapter = this.applicationConfig.getIoAdapter(); |
| 120 | if (adapter) { |
| 121 | (adapter as AbstractWsAdapter).forceCloseConnections = |
| 122 | forceCloseConnections!; |
| 123 | this.isAdapterInitialized = true; |
| 124 | return; |
| 125 | } |
| 126 | const { IoAdapter } = loadAdapter( |
| 127 | '@nestjs/platform-socket.io', |
| 128 | 'WebSockets', |
| 129 | () => require('@nestjs/platform-socket.io'), |
| 130 | ); |
| 131 | const ioAdapter = new IoAdapter(this.httpServer); |
| 132 | ioAdapter.forceCloseConnections = forceCloseConnections; |
| 133 | this.applicationConfig.setIoAdapter(ioAdapter); |
| 134 | |
| 135 | this.isAdapterInitialized = true; |
| 136 | } |
| 137 | |
| 138 | private getContextCreator(container: NestContainer): WsContextCreator { |
| 139 | return new WsContextCreator( |
no test coverage detected