diff options
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/zenserverprocess.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/zenutil/include/zenutil/zenserverprocess.h b/src/zenutil/include/zenutil/zenserverprocess.h index 720b30766..af5125471 100644 --- a/src/zenutil/include/zenutil/zenserverprocess.h +++ b/src/zenutil/include/zenutil/zenserverprocess.h @@ -15,6 +15,8 @@ namespace zen { +class CbObject; + /** Zen Server Environment configuration This class allows a user to configure where a spawned server should place any @@ -171,10 +173,11 @@ public: void Initialize(); [[nodiscard]] bool InitializeReadOnly(); - [[nodiscard]] ZenServerEntry* Lookup(int DesiredListenPort); + [[nodiscard]] ZenServerEntry* Lookup(int DesiredListenPort) const; + [[nodiscard]] ZenServerEntry* LookupByEffectivePort(int Port) const; ZenServerEntry* Register(int DesiredListenPort); void Sweep(); - void Snapshot(std::function<void(const ZenServerEntry&)>&& Callback); + void Snapshot(std::function<void(const ZenServerEntry&)>&& Callback) const; inline bool IsReadOnly() const { return m_IsReadOnly; } private: @@ -185,4 +188,18 @@ private: bool m_IsReadOnly = true; }; +struct LockFileInfo +{ + int32_t Pid; + Oid SessionId; + uint16_t EffectiveListenPort; + bool Ready; + std::filesystem::path DataDir; + std::filesystem::path ExecutablePath; +}; + +CbObject MakeLockFilePayload(const LockFileInfo& Info); +LockFileInfo ReadLockFilePayload(const CbObject& Payload); +bool ValidateLockFileInfo(const LockFileInfo& Info, std::string& OutReason); + } // namespace zen |