MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / EnsureZmqBound

Method EnsureZmqBound

Source/URLab/Private/Bridge/BridgeServer.cpp:35–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool 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
67bool UURLabBridgeServer::EnsureShmBound(const FString& SessionId)
68{

Callers 1

RunTestMethod · 0.80

Calls 4

IsEmptyMethod · 0.80
IsValidMethod · 0.80
SetOwningBridgeMethod · 0.45
TransportInitMethod · 0.45

Tested by 1

RunTestMethod · 0.64