---
title: llarp/service/session.hpp

---

# llarp/service/session.hpp



## Namespaces

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

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::service::Session](Classes/structllarp_1_1service_1_1Session.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/crypto/types.hpp>
#include <llarp/path/path.hpp>
#include "info.hpp"
#include "intro.hpp"
#include <llarp/util/status.hpp>
#include <llarp/util/types.hpp>

namespace llarp
{
  namespace service
  {
    static constexpr auto SessionLifetime = path::default_lifetime * 2;

    struct Session
    {
      Introduction replyIntro;
      SharedSecret sharedKey;
      ServiceInfo remote;
      Introduction intro;

      uint64_t seqno = 0;

      uint64_t messagesSend = 0;
      uint64_t messagesRecv = 0;

      bool inbound = false;
      bool forever = false;

      Duration_t lastSend{};
      Duration_t lastRecv{};

      util::StatusObject
      ExtractStatus() const;

      void
      RX();

      void
      TX();

      bool
      IsExpired(llarp_time_t now, llarp_time_t lifetime = SessionLifetime) const;

      Address
      Addr() const;
    };

  }  // namespace service

}  // namespace llarp
```


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

Updated on 2022-10-25 at 00:38:18 +0000
