---
title: llarp/win32/service_manager.hpp

---

# llarp/win32/service_manager.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::sys](Namespaces/namespacellarp_1_1sys.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| class | **[llarp::sys::SVC_Manager](Classes/classllarp_1_1sys_1_1SVC__Manager.md)**  |




## Source code

```cpp
#pragma once
#include <chrono>
#include <llarp/util/service_manager.hpp>
#include <llarp/util/types.hpp>

namespace llarp::sys
{

  class SVC_Manager : public I_SystemLayerManager
  {
    SERVICE_STATUS _status;

   public:
    SERVICE_STATUS_HANDLE handle;

    // How long we tell Windows to give us to startup before assuming we have stalled/hung.  The
    // biggest potential time here is wintun, which if it is going to fail appears to take around
    // 15s before doing so.
    static constexpr auto StartupTimeout = 17s;

    // How long we tell Windows to give us to fully stop before killing us.
    static constexpr auto StopTimeout = 5s;

    SVC_Manager();

    void
    system_changed_our_state(ServiceState st) override;

    void
    report_changed_state() override;

    void
    we_changed_our_state(ServiceState st) override;
  };
}  // namespace llarp::sys
```


-------------------------------

Updated on 2022-11-04 at 14:36:39 +0000
