---
title: llarp::service::SendContext

---

# llarp::service::SendContext





Inherited by [llarp::service::OutboundContext](Classes/structllarp_1_1service_1_1OutboundContext.md)

## Public Types

|                | Name           |
| -------------- | -------------- |
| using std::shared_ptr< [routing::PathTransferMessage](Classes/structllarp_1_1routing_1_1PathTransferMessage.md) > | **[Msg_ptr](Classes/structllarp_1_1service_1_1SendContext.md#using-msg-ptr)**  |
| using std::pair< Msg_ptr, path::Path_ptr > | **[SendEvent_t](Classes/structllarp_1_1service_1_1SendContext.md#using-sendevent-t)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[SendContext](Classes/structllarp_1_1service_1_1SendContext.md#function-sendcontext)**([ServiceInfo](Classes/structllarp_1_1service_1_1ServiceInfo.md) ident, const [Introduction](Classes/structllarp_1_1service_1_1Introduction.md) & intro, [path::PathSet](Classes/structllarp_1_1path_1_1PathSet.md) * send, [Endpoint](Classes/structllarp_1_1service_1_1Endpoint.md) * ep) |
| void | **[AsyncEncryptAndSendTo](Classes/structllarp_1_1service_1_1SendContext.md#function-asyncencryptandsendto)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & payload, ProtocolType t) |
| bool | **[Send](Classes/structllarp_1_1service_1_1SendContext.md#function-send)**(std::shared_ptr< [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) > f, path::Path_ptr path)<br>queue send a fully encrypted hidden service frame via a path  |
| void | **[FlushUpstream](Classes/structllarp_1_1service_1_1SendContext.md#function-flushupstream)**()<br>flush upstream traffic when in router thread  |
| virtual bool | **[ShiftIntroduction](Classes/structllarp_1_1service_1_1SendContext.md#function-shiftintroduction)**(bool rebuild =true) |
| virtual void | **[ShiftIntroRouter](Classes/structllarp_1_1service_1_1SendContext.md#function-shiftintrorouter)**(const RouterID) =0 |
| virtual void | **[UpdateIntroSet](Classes/structllarp_1_1service_1_1SendContext.md#function-updateintroset)**() =0 |
| virtual void | **[MarkCurrentIntroBad](Classes/structllarp_1_1service_1_1SendContext.md#function-markcurrentintrobad)**(llarp_time_t now) =0 |
| void | **[AsyncSendAuth](Classes/structllarp_1_1service_1_1SendContext.md#function-asyncsendauth)**(std::function< void([AuthResult](Classes/structllarp_1_1service_1_1AuthResult.md))> replyHandler) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [SharedSecret](Classes/structllarp_1_1AlignedBuffer.md) | **[sharedKey](Classes/structllarp_1_1service_1_1SendContext.md#variable-sharedkey)**  |
| [ServiceInfo](Classes/structllarp_1_1service_1_1ServiceInfo.md) | **[remoteIdent](Classes/structllarp_1_1service_1_1SendContext.md#variable-remoteident)**  |
| [Introduction](Classes/structllarp_1_1service_1_1Introduction.md) | **[remoteIntro](Classes/structllarp_1_1service_1_1SendContext.md#variable-remoteintro)**  |
| [ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) | **[currentConvoTag](Classes/structllarp_1_1service_1_1SendContext.md#variable-currentconvotag)**  |
| [path::PathSet](Classes/structllarp_1_1path_1_1PathSet.md) *const | **[m_PathSet](Classes/structllarp_1_1service_1_1SendContext.md#variable-m-pathset)**  |
| [IDataHandler](Classes/structllarp_1_1service_1_1IDataHandler.md) *const | **[m_DataHandler](Classes/structllarp_1_1service_1_1SendContext.md#variable-m-datahandler)**  |
| [Endpoint](Classes/structllarp_1_1service_1_1Endpoint.md) *const | **[m_Endpoint](Classes/structllarp_1_1service_1_1SendContext.md#variable-m-endpoint)**  |
| uint64_t | **[sequenceNo](Classes/structllarp_1_1service_1_1SendContext.md#variable-sequenceno)**  |
| llarp_time_t | **[lastGoodSend](Classes/structllarp_1_1service_1_1SendContext.md#variable-lastgoodsend)**  |
| const llarp_time_t | **[createdAt](Classes/structllarp_1_1service_1_1SendContext.md#variable-createdat)**  |
| llarp_time_t | **[sendTimeout](Classes/structllarp_1_1service_1_1SendContext.md#variable-sendtimeout)**  |
| llarp_time_t | **[connectTimeout](Classes/structllarp_1_1service_1_1SendContext.md#variable-connecttimeout)**  |
| llarp_time_t | **[shiftTimeout](Classes/structllarp_1_1service_1_1SendContext.md#variable-shifttimeout)**  |
| llarp_time_t | **[estimatedRTT](Classes/structllarp_1_1service_1_1SendContext.md#variable-estimatedrtt)**  |
| bool | **[markedBad](Classes/structllarp_1_1service_1_1SendContext.md#variable-markedbad)**  |
| [thread::Queue](Classes/classllarp_1_1thread_1_1Queue.md)< SendEvent_t > | **[m_SendQueue](Classes/structllarp_1_1service_1_1SendContext.md#variable-m-sendqueue)**  |
| std::function< void([AuthResult](Classes/structllarp_1_1service_1_1AuthResult.md))> | **[authResultListener](Classes/structllarp_1_1service_1_1SendContext.md#variable-authresultlistener)**  |

## Public Types Documentation

### using Msg_ptr

```cpp
using llarp::service::SendContext::Msg_ptr =  std::shared_ptr<routing::PathTransferMessage>;
```


### using SendEvent_t

```cpp
using llarp::service::SendContext::SendEvent_t =  std::pair<Msg_ptr, path::Path_ptr>;
```


## Public Functions Documentation

### function SendContext

```cpp
SendContext(
    ServiceInfo ident,
    const Introduction & intro,
    path::PathSet * send,
    Endpoint * ep
)
```


### function AsyncEncryptAndSendTo

```cpp
void AsyncEncryptAndSendTo(
    const llarp_buffer_t & payload,
    ProtocolType t
)
```


### function Send

```cpp
bool Send(
    std::shared_ptr< ProtocolFrame > f,
    path::Path_ptr path
)
```

queue send a fully encrypted hidden service frame via a path 

### function FlushUpstream

```cpp
void FlushUpstream()
```

flush upstream traffic when in router thread 

### function ShiftIntroduction

```cpp
inline virtual bool ShiftIntroduction(
    bool rebuild =true
)
```


**Reimplemented by**: [llarp::service::OutboundContext::ShiftIntroduction](Classes/structllarp_1_1service_1_1OutboundContext.md#function-shiftintroduction)


### function ShiftIntroRouter

```cpp
virtual void ShiftIntroRouter(
    const RouterID
) =0
```


**Reimplemented by**: [llarp::service::OutboundContext::ShiftIntroRouter](Classes/structllarp_1_1service_1_1OutboundContext.md#function-shiftintrorouter)


### function UpdateIntroSet

```cpp
virtual void UpdateIntroSet() =0
```


**Reimplemented by**: [llarp::service::OutboundContext::UpdateIntroSet](Classes/structllarp_1_1service_1_1OutboundContext.md#function-updateintroset)


### function MarkCurrentIntroBad

```cpp
virtual void MarkCurrentIntroBad(
    llarp_time_t now
) =0
```


**Reimplemented by**: [llarp::service::OutboundContext::MarkCurrentIntroBad](Classes/structllarp_1_1service_1_1OutboundContext.md#function-markcurrentintrobad)


### function AsyncSendAuth

```cpp
void AsyncSendAuth(
    std::function< void(AuthResult)> replyHandler
)
```


## Public Attributes Documentation

### variable sharedKey

```cpp
SharedSecret sharedKey;
```


### variable remoteIdent

```cpp
ServiceInfo remoteIdent;
```


### variable remoteIntro

```cpp
Introduction remoteIntro;
```


### variable currentConvoTag

```cpp
ConvoTag currentConvoTag;
```


### variable m_PathSet

```cpp
path::PathSet *const m_PathSet;
```


### variable m_DataHandler

```cpp
IDataHandler *const m_DataHandler;
```


### variable m_Endpoint

```cpp
Endpoint *const m_Endpoint;
```


### variable sequenceNo

```cpp
uint64_t sequenceNo = 0;
```


### variable lastGoodSend

```cpp
llarp_time_t lastGoodSend = 0s;
```


### variable createdAt

```cpp
const llarp_time_t createdAt;
```


### variable sendTimeout

```cpp
llarp_time_t sendTimeout = path::build_timeout;
```


### variable connectTimeout

```cpp
llarp_time_t connectTimeout = path::build_timeout * 2;
```


### variable shiftTimeout

```cpp
llarp_time_t shiftTimeout = (path::build_timeout * 5) / 2;
```


### variable estimatedRTT

```cpp
llarp_time_t estimatedRTT = 0s;
```


### variable markedBad

```cpp
bool markedBad = false;
```


### variable m_SendQueue

```cpp
thread::Queue< SendEvent_t > m_SendQueue;
```


### variable authResultListener

```cpp
std::function< void(AuthResult)> authResultListener;
```


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

Updated on 2022-09-01 at 18:16:54 +0000