Files
UnrealEngineUWP/Engine/Source/Programs/UnrealTraceServer/src/StoreCborServer.h
johan berg 7f207485e4 Implement hooks for store service to shut down if there are no active connections.
#rb ionut.matasaru

[CL 30150148 by johan berg in ue5-main branch]
2023-12-06 04:41:52 -05:00

46 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Asio.h"
#include "AsioTcpServer.h"
#include "AsioTickable.h"
#include "Foundation.h"
class FRecorder;
class FStore;
class FStoreCborPeer;
class FTraceRelay;
class FStoreSettings;
////////////////////////////////////////////////////////////////////////////////
class FStoreCborServer
: public FAsioTcpServer
, public FAsioTickable
{
friend class FStoreCborPeer;
public:
FStoreCborServer(asio::io_context& IoContext, FStoreSettings* InSettings, FStore& InStore, FRecorder& InRecorder);
~FStoreCborServer();
void Close();
FStore& GetStore() const;
FRecorder& GetRecorder() const;
FTraceRelay* RelayTrace(uint32 Id);
void OnSettingsChanged();
uint32 GetActivePeerCount() const { return Peers.Num(); }
private:
virtual bool OnAccept(asio::ip::tcp::socket& Socket) override;
virtual void OnTick() override;
FStoreSettings* GetSettings() const { return Settings; }
TArray<FStoreCborPeer*> Peers;
TArray<FTraceRelay*> Relays;
FStore& Store;
FRecorder& Recorder;
FStoreSettings* Settings;
};
/* vim: set noexpandtab : */