| 33 | } |
| 34 | |
| 35 | bool UURLabBridgeServer::EnsureZmqBound(const FString& Endpoint) |
| 36 | { |
| 37 | if (Endpoint.IsEmpty()) |
| 38 | return false; |
| 39 | |
| 40 | if (!Dispatcher.IsValid()) |
| 41 | { |
| 42 | Dispatcher = MakeUnique<FURLabRpcDispatcher>(); |
| 43 | } |
| 44 | |
| 45 | for (const TObjectPtr<UURLabRpcTransport>& T : RpcTransports) |
| 46 | { |
| 47 | UURLabZmqRpcTransport* Existing = Cast<UURLabZmqRpcTransport>(T); |
| 48 | if (Existing && Existing->StepEndpoint == Endpoint) |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | UURLabZmqRpcTransport* Zmq = NewObject<UURLabZmqRpcTransport>(this, TEXT("BridgeZmqTransport")); |
| 53 | Zmq->StepEndpoint = Endpoint; |
| 54 | Zmq->SetOwningBridge(this); |
| 55 | if (!Zmq->TransportInit()) |
| 56 | { |
| 57 | UE_LOG(LogURLabNet, Error, |
| 58 | TEXT("UURLabBridgeServer: ZMQ bind failed on %s"), *Endpoint); |
| 59 | return false; |
| 60 | } |
| 61 | RpcTransports.Add(Zmq); |
| 62 | UE_LOG(LogURLabNet, Log, |
| 63 | TEXT("UURLabBridgeServer: ZMQ REP bound at %s"), *Endpoint); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | bool UURLabBridgeServer::EnsureShmBound(const FString& SessionId) |
| 68 | { |