| 102 | } |
| 103 | |
| 104 | void UURLabBridgeServer::Stop() |
| 105 | { |
| 106 | // Drain before tearing transports down so blocking handlers see the |
| 107 | // flag on their next 50ms tick and return `shutting_down` instead of |
| 108 | // pinning the worker thread. |
| 109 | if (Dispatcher.IsValid()) |
| 110 | { |
| 111 | Dispatcher->SetDraining(true); |
| 112 | } |
| 113 | |
| 114 | for (const TObjectPtr<UURLabRpcTransport>& T : RpcTransports) |
| 115 | { |
| 116 | if (T) |
| 117 | T->TransportShutdown(); |
| 118 | } |
| 119 | RpcTransports.Reset(); |
| 120 | |
| 121 | if (!Dispatcher.IsValid()) |
| 122 | return; |
| 123 | Dispatcher->Shutdown(); |
| 124 | Dispatcher.Reset(); |
| 125 | ActiveManager.Reset(); |
| 126 | } |
| 127 | |
| 128 | void UURLabBridgeServer::RegisterManager(AAMjManager* InManager) |
| 129 | { |