Document of c-modernization-kit (porter) 1.0.0
Loading...
Searching...
No Matches
PotrContext_ Struct Reference

セッションコンテキスト構造体。PotrHandle の実体。 More...

#include <potrContext.h>

Collaboration diagram for PotrContext_:

Data Fields

PotrRecvCallback callback
 受信コールバック。
PotrThread recv_thread [POTR_MAX_PATH]
 受信スレッドハンドル (path ごと)。
PotrThread health_thread [POTR_MAX_PATH]
 ヘルスチェックスレッドハンドル (path ごと、送信者のみ)。
PotrMutex health_mutex [POTR_MAX_PATH]
 ヘルスチェックスレッド停止用ミューテックス (path ごと)。
PotrCondVar health_wakeup [POTR_MAX_PATH]
 ヘルスチェックスレッドを即時起床させる条件変数 (path ごと)。
PotrServiceDef service
 サービス定義。
PotrGlobalConfig global
 グローバル設定。
PotrWindow send_window
 送信バッファ (過去 N パケット保持。NACK 再送・REJECT 判定に使用)。
PotrMutex send_window_mutex
 send_window 保護用ミューテックス (送信スレッド・ヘルスチェックスレッド・受信スレッドが競合するため)。
PotrWindow recv_window
 受信ウィンドウ (順序整列・欠番検出)。
PotrSocket sock [POTR_MAX_PATH]
 各パスの UDP ソケット。
int n_path
 有効パス数。
volatile int running [POTR_MAX_PATH]
 受信スレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。
volatile int health_running [POTR_MAX_PATH]
 ヘルスチェックスレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。
volatile int health_alive
 疎通状態 (1: alive, 0: dead/未接続)。UDP 用。受信者が管理。
PotrRole role
 役割 (POTR_ROLE_SENDER / POTR_ROLE_RECEIVER)。
struct in_addr src_addr_resolved [POTR_MAX_PATH]
 解決済み送信元 IPv4 アドレス。
struct in_addr dst_addr_resolved [POTR_MAX_PATH]
 解決済み宛先 IPv4 アドレス (unicast のみ)。
struct sockaddr_in dest_addr [POTR_MAX_PATH]
 送信先ソケットアドレス (送信者が sendto に使用)。
uint32_t session_id
 自セッション識別子 (乱数)。
int64_t session_tv_sec
 自セッション開始時刻 秒部。
int32_t session_tv_nsec
 自セッション開始時刻 ナノ秒部。
uint32_t peer_session_id
 追跡中の相手セッション識別子。
int64_t peer_session_tv_sec
 追跡中の相手セッション開始時刻 秒部。
int32_t peer_session_tv_nsec
 追跡中の相手セッション開始時刻 ナノ秒部。
int peer_session_known
 相手セッションが初期化済みか (0: 未初期化)。
uint16_t peer_port [POTR_MAX_PATH]
 各パスで観測した送信者ポート (NBO)。0 = 未観測。
int32_t last_recv_tv_nsec
 最終受信時刻 ナノ秒部。
uint32_t _pad_lastrecv
 パディング (last_recv_tv_sec を 8 バイト境界に揃える)。
int64_t last_recv_tv_sec
 最終受信時刻 秒部。0 = 未受信。
int64_t path_last_recv_sec [POTR_MAX_PATH]
 パスごとの最終受信時刻 秒部。0 = 未受信。
int32_t path_last_recv_nsec [POTR_MAX_PATH]
 パスごとの最終受信時刻 ナノ秒部。
size_t frag_buf_len
 フラグメント結合バッファの現在のデータ長 (バイト)。
int frag_compressed
 フラグメント受信中の圧縮フラグ (非 0: 圧縮あり)。
uint32_t _pad_frag
 パディング (frag_buf を 8 バイト境界に揃える)。
uint8_t * frag_buf
 フラグメント結合バッファ (動的確保。max_message_size バイト)。
uint8_t * compress_buf
 圧縮・解凍用一時バッファ (動的確保)。
size_t compress_buf_size
 compress_buf のサイズ (バイト)。
uint8_t * crypto_buf
 暗号化・復号用一時バッファ (動的確保)。
size_t crypto_buf_size
 crypto_buf のサイズ (バイト)。
uint8_t * recv_buf
 受信バッファ / 再送 wire 組立バッファ (動的確保。PACKET_HEADER_SIZE + max_payload バイト)。
uint8_t * send_wire_buf
 送信 wire 組立バッファ (動的確保。PACKET_HEADER_SIZE + max_payload バイト)。送信スレッドのみ使用。
PotrThread send_thread
 送信スレッドハンドル。
volatile int send_thread_running
 送信スレッド実行フラグ (1: 実行中, 0: 停止)。
uint32_t _pad_send_thread
 パディング (last_send_ms を 8 バイト境界に揃える)。
volatile uint64_t last_send_ms
 最終パケット送信時刻 (データ or PING、ms、単調増加)。0 = 未送信。
PotrNackDedupEntry nack_dedup_buf [POTR_NACK_DEDUP_SLOTS]
 NACK 重複抑制エントリ配列。
uint8_t nack_dedup_next
 次に書き込むスロットインデックス。
uint8_t _pad_nack_dedup [7]
 パディング (reorder フィールドを 4 バイト境界に揃える)。
int reorder_pending
 リオーダー待機中か (1: 待機中、0: 待機なし)。
uint32_t reorder_nack_num
 待機中の欠番通番。
int64_t reorder_deadline_sec
 タイムアウト期限 秒部 (CLOCK_MONOTONIC)。
int32_t reorder_deadline_nsec
 タイムアウト期限 ナノ秒部。
uint32_t _pad_reorder
 パディング (send_queue を 8 バイト境界に揃える)。
PotrSendQueue send_queue
 非同期送信キュー。
int is_multi_peer
 1: N:1 モード (src_addr/src_port 省略), 0: 1:1 モード。
uint32_t _pad_multi_peer
 パディング (peers を 8 バイト境界に揃える)。
PotrPeerContextpeers
 ピアテーブル (動的確保。max_peers エントリ)。
int max_peers
 ピアテーブルサイズ (service.max_peers から取得)。
int n_peers
 現在の接続ピア数。
PotrMutex peers_mutex
 ピアテーブル保護用ミューテックス。
uint32_t next_peer_id
 次に発行するピア ID (単調増加、初期値 1)。
PotrSocket tcp_listen_sock [POTR_MAX_PATH]
 RECEIVER: listen ソケット (path ごと)。
PotrSocket tcp_conn_fd [POTR_MAX_PATH]
 アクティブ TCP 接続 fd (path ごと)。
volatile int tcp_active_paths
 アクティブ TCP path 数 (0 = 全切断)。
uint32_t _pad_tcp_connected [2]
 パディング (tcp_send_mutex を 8 バイト境界に揃える。8 バイト確保)。
PotrMutex tcp_send_mutex [POTR_MAX_PATH]
 TCP send() 排他制御 (path ごと)。送信スレッド・ヘルスチェックスレッド・recv スレッド競合防止。
PotrMutex recv_window_mutex
 recv_window 保護用ミューテックス。
PotrThread connect_thread [POTR_MAX_PATH]
 SENDER: connect スレッド。RECEIVER: accept スレッド。path ごと。
volatile int connect_thread_running [POTR_MAX_PATH]
 connect スレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。
PotrMutex tcp_state_mutex
 tcp_state_cv 保護用ミューテックス。tcp_active_paths のカウンタ更新も保護。
PotrCondVar tcp_state_cv
 切断通知・reconnect sleep の中断用条件変数。
volatile uint64_t tcp_last_ping_recv_ms [POTR_MAX_PATH]
 TCP PING 応答最終受信時刻 (ms, CLOCK_MONOTONIC 基準)。path ごと。接続確立時に現在時刻で初期化。
volatile uint64_t tcp_last_ping_req_recv_ms [POTR_MAX_PATH]
 TCP PING 要求最終受信時刻 (ms, CLOCK_MONOTONIC 基準)。path ごと。接続確立時に現在時刻で初期化。
int buf_full_suppress_cnt [POTR_MAX_PATH]
 path ごとの送信バッファ満杯ログ抑制カウンタ (0: 抑制なし、1-10: 抑制中)。
PotrMutex session_establish_mutex
uint8_t * tcp_first_pkt_buf [POTR_MAX_PATH]
 先読みパケットバッファ (動的確保、PACKET_HEADER_SIZE + max_payload バイト)。
size_t tcp_first_pkt_len [POTR_MAX_PATH]
 先読みパケットのバイト数 (0: 先読みなし)。

Detailed Description

セッションコンテキスト構造体。PotrHandle の実体。

Definition at line 155 of file potrContext.h.

Field Documentation

◆ callback

◆ recv_thread

PotrThread PotrContext_::recv_thread[POTR_MAX_PATH]

受信スレッドハンドル (path ごと)。

Definition at line 158 of file potrContext.h.

Referenced by comm_recv_thread_start(), comm_recv_thread_stop(), join_recv_thread(), tcp_recv_thread_start(), and tcp_recv_thread_stop().

◆ health_thread

PotrThread PotrContext_::health_thread[POTR_MAX_PATH]

ヘルスチェックスレッドハンドル (path ごと、送信者のみ)。

Definition at line 159 of file potrContext.h.

Referenced by potr_health_thread_start(), potr_health_thread_stop(), potr_tcp_health_thread_start(), and potr_tcp_health_thread_stop().

◆ health_mutex

PotrMutex PotrContext_::health_mutex[POTR_MAX_PATH]

ヘルスチェックスレッド停止用ミューテックス (path ごと)。

Definition at line 160 of file potrContext.h.

Referenced by flush_packed(), health_sleep(), potr_health_thread_start(), potr_health_thread_stop(), potr_tcp_health_thread_stop(), potrCloseService(), and potrOpenService().

◆ health_wakeup

PotrCondVar PotrContext_::health_wakeup[POTR_MAX_PATH]

ヘルスチェックスレッドを即時起床させる条件変数 (path ごと)。

Definition at line 161 of file potrContext.h.

Referenced by flush_packed(), health_sleep(), potr_health_thread_start(), potr_health_thread_stop(), potr_tcp_health_thread_stop(), potrCloseService(), and potrOpenService().

◆ service

◆ global

◆ send_window

PotrWindow PotrContext_::send_window

送信バッファ (過去 N パケット保持。NACK 再送・REJECT 判定に使用)。

Definition at line 164 of file potrContext.h.

Referenced by ctx_cleanup(), flush_packed(), health_thread_func(), potrCloseService(), potrOpenService(), recv_thread_func(), reset_all_paths_disconnected(), send_ping_reply(), tcp_health_thread_func(), and tcp_send_ping_reply().

◆ send_window_mutex

PotrMutex PotrContext_::send_window_mutex

send_window 保護用ミューテックス (送信スレッド・ヘルスチェックスレッド・受信スレッドが競合するため)。

Definition at line 165 of file potrContext.h.

Referenced by flush_packed(), health_thread_func(), potr_send_thread_start(), potr_send_thread_stop(), recv_thread_func(), send_ping_reply(), tcp_health_thread_func(), and tcp_send_ping_reply().

◆ recv_window

PotrWindow PotrContext_::recv_window

◆ sock

◆ n_path

◆ running

volatile int PotrContext_::running[POTR_MAX_PATH]

受信スレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。

Definition at line 172 of file potrContext.h.

Referenced by comm_recv_thread_start(), comm_recv_thread_stop(), potrCloseService(), receiver_accept_loop(), recv_thread_func(), start_connected_threads(), tcp_recv_thread_func(), tcp_recv_thread_start(), and tcp_recv_thread_stop().

◆ health_running

volatile int PotrContext_::health_running[POTR_MAX_PATH]

ヘルスチェックスレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。

Definition at line 173 of file potrContext.h.

Referenced by flush_packed(), health_sleep(), health_thread_func(), potr_health_thread_start(), potr_health_thread_stop(), potr_tcp_health_thread_start(), potr_tcp_health_thread_stop(), potrCloseService(), and tcp_health_thread_func().

◆ health_alive

volatile int PotrContext_::health_alive

疎通状態 (1: alive, 0: dead/未接続)。UDP 用。受信者が管理。

Definition at line 174 of file potrContext.h.

Referenced by check_health_timeout(), notify_connected_tcp(), notify_health_alive(), raw_session_disconnect(), recv_thread_func(), and reset_all_paths_disconnected().

◆ role

◆ src_addr_resolved

struct in_addr PotrContext_::src_addr_resolved[POTR_MAX_PATH]

◆ dst_addr_resolved

struct in_addr PotrContext_::dst_addr_resolved[POTR_MAX_PATH]

解決済み宛先 IPv4 アドレス (unicast のみ)。

Definition at line 179 of file potrContext.h.

Referenced by check_src_addr(), open_socket_tcp_receiver(), open_socket_tcp_sender(), potrOpenService(), and tcp_connect_with_timeout().

◆ dest_addr

struct sockaddr_in PotrContext_::dest_addr[POTR_MAX_PATH]

送信先ソケットアドレス (送信者が sendto に使用)。

Definition at line 180 of file potrContext.h.

Referenced by check_health_timeout(), flush_packed(), health_thread_func(), potrOpenService(), recv_thread_func(), send_fin(), send_nack(), send_ping_reply(), send_reject(), and update_path_recv().

◆ session_id

uint32_t PotrContext_::session_id

◆ session_tv_sec

int64_t PotrContext_::session_tv_sec

◆ session_tv_nsec

int32_t PotrContext_::session_tv_nsec

自セッション開始時刻 ナノ秒部。

Definition at line 185 of file potrContext.h.

Referenced by flush_packed(), generate_session(), health_thread_func(), send_fin(), send_nack(), send_ping_reply(), send_reject(), tcp_health_thread_func(), and tcp_send_ping_reply().

◆ peer_session_id

uint32_t PotrContext_::peer_session_id

追跡中の相手セッション識別子。

Definition at line 188 of file potrContext.h.

Referenced by check_and_update_session(), receiver_accept_loop(), and tcp_session_compare().

◆ peer_session_tv_sec

int64_t PotrContext_::peer_session_tv_sec

追跡中の相手セッション開始時刻 秒部。

Definition at line 189 of file potrContext.h.

Referenced by check_and_update_session(), and tcp_session_compare().

◆ peer_session_tv_nsec

int32_t PotrContext_::peer_session_tv_nsec

追跡中の相手セッション開始時刻 ナノ秒部。

Definition at line 190 of file potrContext.h.

Referenced by check_and_update_session(), and tcp_session_compare().

◆ peer_session_known

int PotrContext_::peer_session_known

相手セッションが初期化済みか (0: 未初期化)。

Definition at line 191 of file potrContext.h.

Referenced by check_and_update_session(), check_health_timeout(), check_reorder_timeout(), recv_thread_func(), reset_all_paths_disconnected(), reset_connection_state(), and tcp_session_compare().

◆ peer_port

uint16_t PotrContext_::peer_port[POTR_MAX_PATH]

各パスで観測した送信者ポート (NBO)。0 = 未観測。

Definition at line 194 of file potrContext.h.

Referenced by check_health_timeout(), send_nack(), and update_path_recv().

◆ last_recv_tv_nsec

int32_t PotrContext_::last_recv_tv_nsec

最終受信時刻 ナノ秒部。

Definition at line 197 of file potrContext.h.

Referenced by check_health_timeout(), and update_path_recv().

◆ _pad_lastrecv

uint32_t PotrContext_::_pad_lastrecv

パディング (last_recv_tv_sec を 8 バイト境界に揃える)。

Definition at line 198 of file potrContext.h.

◆ last_recv_tv_sec

int64_t PotrContext_::last_recv_tv_sec

最終受信時刻 秒部。0 = 未受信。

Definition at line 199 of file potrContext.h.

Referenced by check_health_timeout(), check_reorder_timeout(), recv_thread_func(), and update_path_recv().

◆ path_last_recv_sec

int64_t PotrContext_::path_last_recv_sec[POTR_MAX_PATH]

パスごとの最終受信時刻 秒部。0 = 未受信。

Definition at line 202 of file potrContext.h.

Referenced by check_health_timeout(), and update_path_recv().

◆ path_last_recv_nsec

int32_t PotrContext_::path_last_recv_nsec[POTR_MAX_PATH]

パスごとの最終受信時刻 ナノ秒部。

Definition at line 203 of file potrContext.h.

Referenced by check_health_timeout(), and update_path_recv().

◆ frag_buf_len

size_t PotrContext_::frag_buf_len

フラグメント結合バッファの現在のデータ長 (バイト)。

Definition at line 205 of file potrContext.h.

Referenced by deliver_payload_elem(), raw_session_disconnect(), reset_all_paths_disconnected(), and reset_connection_state().

◆ frag_compressed

int PotrContext_::frag_compressed

フラグメント受信中の圧縮フラグ (非 0: 圧縮あり)。

Definition at line 206 of file potrContext.h.

Referenced by deliver_payload_elem(), and raw_session_disconnect().

◆ _pad_frag

uint32_t PotrContext_::_pad_frag

パディング (frag_buf を 8 バイト境界に揃える)。

Definition at line 207 of file potrContext.h.

◆ frag_buf

uint8_t* PotrContext_::frag_buf

フラグメント結合バッファ (動的確保。max_message_size バイト)。

Definition at line 208 of file potrContext.h.

Referenced by ctx_cleanup(), deliver_payload_elem(), potrCloseService(), and potrOpenService().

◆ compress_buf

uint8_t* PotrContext_::compress_buf

圧縮・解凍用一時バッファ (動的確保)。

Definition at line 209 of file potrContext.h.

Referenced by ctx_cleanup(), n1_recv_deliver(), potrCloseService(), potrOpenService(), potrSend(), and recv_deliver().

◆ compress_buf_size

size_t PotrContext_::compress_buf_size

compress_buf のサイズ (バイト)。

Definition at line 210 of file potrContext.h.

Referenced by n1_recv_deliver(), potrOpenService(), potrSend(), and recv_deliver().

◆ crypto_buf

uint8_t* PotrContext_::crypto_buf

暗号化・復号用一時バッファ (動的確保)。

Definition at line 211 of file potrContext.h.

Referenced by ctx_cleanup(), flush_packed(), flush_packed_peer(), potrCloseService(), potrOpenService(), recv_thread_func(), and tcp_recv_thread_func().

◆ crypto_buf_size

size_t PotrContext_::crypto_buf_size

crypto_buf のサイズ (バイト)。

Definition at line 212 of file potrContext.h.

Referenced by flush_packed(), flush_packed_peer(), potrOpenService(), recv_thread_func(), and tcp_recv_thread_func().

◆ recv_buf

uint8_t* PotrContext_::recv_buf

受信バッファ / 再送 wire 組立バッファ (動的確保。PACKET_HEADER_SIZE + max_payload バイト)。

Definition at line 213 of file potrContext.h.

Referenced by ctx_cleanup(), potrCloseService(), potrOpenService(), recv_thread_func(), and tcp_recv_thread_func().

◆ send_wire_buf

uint8_t* PotrContext_::send_wire_buf

送信 wire 組立バッファ (動的確保。PACKET_HEADER_SIZE + max_payload バイト)。送信スレッドのみ使用。

Definition at line 214 of file potrContext.h.

Referenced by ctx_cleanup(), flush_packed(), flush_packed_peer(), potrCloseService(), potrOpenService(), send_packed_peer_mode(), and send_thread_func().

◆ send_thread

PotrThread PotrContext_::send_thread

送信スレッドハンドル。

Definition at line 217 of file potrContext.h.

Referenced by potr_send_thread_start(), and potr_send_thread_stop().

◆ send_thread_running

volatile int PotrContext_::send_thread_running

送信スレッド実行フラグ (1: 実行中, 0: 停止)。

Definition at line 218 of file potrContext.h.

Referenced by potr_send_thread_start(), potr_send_thread_stop(), potrCloseService(), send_thread_func(), send_to_peer(), and start_connected_threads().

◆ _pad_send_thread

uint32_t PotrContext_::_pad_send_thread

パディング (last_send_ms を 8 バイト境界に揃える)。

Definition at line 219 of file potrContext.h.

◆ last_send_ms

volatile uint64_t PotrContext_::last_send_ms

最終パケット送信時刻 (データ or PING、ms、単調増加)。0 = 未送信。

Definition at line 220 of file potrContext.h.

Referenced by flush_packed(), flush_packed_peer(), and health_thread_func().

◆ nack_dedup_buf

PotrNackDedupEntry PotrContext_::nack_dedup_buf[POTR_NACK_DEDUP_SLOTS]

NACK 重複抑制エントリ配列。

Definition at line 223 of file potrContext.h.

Referenced by recv_thread_func().

◆ nack_dedup_next

uint8_t PotrContext_::nack_dedup_next

次に書き込むスロットインデックス。

Definition at line 224 of file potrContext.h.

Referenced by recv_thread_func().

◆ _pad_nack_dedup

uint8_t PotrContext_::_pad_nack_dedup[7]

パディング (reorder フィールドを 4 バイト境界に揃える)。

Definition at line 225 of file potrContext.h.

◆ reorder_pending

int PotrContext_::reorder_pending

リオーダー待機中か (1: 待機中、0: 待機なし)。

Definition at line 228 of file potrContext.h.

Referenced by check_and_update_session(), check_health_timeout(), check_reorder_timeout(), process_outer_pkt(), recv_thread_func(), and reorder_gap_ready().

◆ reorder_nack_num

uint32_t PotrContext_::reorder_nack_num

待機中の欠番通番。

Definition at line 229 of file potrContext.h.

Referenced by check_reorder_timeout(), and reorder_gap_ready().

◆ reorder_deadline_sec

int64_t PotrContext_::reorder_deadline_sec

タイムアウト期限 秒部 (CLOCK_MONOTONIC)。

Definition at line 230 of file potrContext.h.

Referenced by reorder_gap_ready().

◆ reorder_deadline_nsec

int32_t PotrContext_::reorder_deadline_nsec

タイムアウト期限 ナノ秒部。

Definition at line 231 of file potrContext.h.

Referenced by reorder_gap_ready().

◆ _pad_reorder

uint32_t PotrContext_::_pad_reorder

パディング (send_queue を 8 バイト境界に揃える)。

Definition at line 232 of file potrContext.h.

◆ send_queue

PotrSendQueue PotrContext_::send_queue

◆ is_multi_peer

int PotrContext_::is_multi_peer

1: N:1 モード (src_addr/src_port 省略), 0: 1:1 モード。

Definition at line 237 of file potrContext.h.

Referenced by check_src_addr(), ctx_cleanup(), health_thread_func(), potrCloseService(), potrDisconnectPeer(), potrOpenService(), potrSend(), recv_thread_func(), and send_thread_func().

◆ _pad_multi_peer

uint32_t PotrContext_::_pad_multi_peer

パディング (peers を 8 バイト境界に揃える)。

Definition at line 238 of file potrContext.h.

◆ peers

PotrPeerContext* PotrContext_::peers

◆ max_peers

int PotrContext_::max_peers

ピアテーブルサイズ (service.max_peers から取得)。

Definition at line 240 of file potrContext.h.

Referenced by allocate_peer_id(), health_thread_func(), n1_check_health_timeout(), peer_create(), peer_find_by_id(), peer_find_by_session(), peer_table_destroy(), peer_table_init(), potrOpenService(), and potrSend().

◆ n_peers

int PotrContext_::n_peers

現在の接続ピア数。

Definition at line 241 of file potrContext.h.

Referenced by peer_create(), peer_free(), peer_table_destroy(), and peer_table_init().

◆ peers_mutex

PotrMutex PotrContext_::peers_mutex

ピアテーブル保護用ミューテックス。

Definition at line 242 of file potrContext.h.

Referenced by health_thread_func(), n1_check_health_timeout(), peer_table_destroy(), peer_table_init(), potrDisconnectPeer(), potrSend(), recv_thread_func(), and send_packed_peer_mode().

◆ next_peer_id

uint32_t PotrContext_::next_peer_id

次に発行するピア ID (単調増加、初期値 1)。

Definition at line 243 of file potrContext.h.

Referenced by allocate_peer_id(), and peer_table_init().

◆ tcp_listen_sock

PotrSocket PotrContext_::tcp_listen_sock[POTR_MAX_PATH]

RECEIVER: listen ソケット (path ごと)。

Definition at line 246 of file potrContext.h.

Referenced by ctx_cleanup(), open_socket_tcp_receiver(), potr_connect_thread_stop(), potrOpenService(), and receiver_accept_loop().

◆ tcp_conn_fd

◆ tcp_active_paths

volatile int PotrContext_::tcp_active_paths

アクティブ TCP path 数 (0 = 全切断)。

Definition at line 248 of file potrContext.h.

Referenced by flush_packed(), potrSend(), receiver_accept_loop(), sender_connect_loop(), and tcp_health_thread_func().

◆ _pad_tcp_connected

uint32_t PotrContext_::_pad_tcp_connected[2]

パディング (tcp_send_mutex を 8 バイト境界に揃える。8 バイト確保)。

Definition at line 249 of file potrContext.h.

◆ tcp_send_mutex

PotrMutex PotrContext_::tcp_send_mutex[POTR_MAX_PATH]

TCP send() 排他制御 (path ごと)。送信スレッド・ヘルスチェックスレッド・recv スレッド競合防止。

Definition at line 250 of file potrContext.h.

Referenced by flush_packed(), potrCloseService(), potrOpenService(), tcp_health_thread_func(), and tcp_send_ping_reply().

◆ recv_window_mutex

PotrMutex PotrContext_::recv_window_mutex

recv_window 保護用ミューテックス。

Definition at line 253 of file potrContext.h.

Referenced by potrCloseService(), potrOpenService(), and tcp_recv_thread_func().

◆ connect_thread

PotrThread PotrContext_::connect_thread[POTR_MAX_PATH]

SENDER: connect スレッド。RECEIVER: accept スレッド。path ごと。

Definition at line 256 of file potrContext.h.

Referenced by potr_connect_thread_start(), and potr_connect_thread_stop().

◆ connect_thread_running

volatile int PotrContext_::connect_thread_running[POTR_MAX_PATH]

connect スレッド実行フラグ (1: 実行中, 0: 停止)。path ごと。

Definition at line 257 of file potrContext.h.

Referenced by connect_thread_func(), potr_connect_thread_start(), potr_connect_thread_stop(), receiver_accept_loop(), reconnect_wait(), and sender_connect_loop().

◆ tcp_state_mutex

PotrMutex PotrContext_::tcp_state_mutex

tcp_state_cv 保護用ミューテックス。tcp_active_paths のカウンタ更新も保護。

Definition at line 260 of file potrContext.h.

Referenced by notify_connected_tcp(), potr_connect_thread_stop(), potrCloseService(), potrOpenService(), receiver_accept_loop(), reconnect_wait(), and sender_connect_loop().

◆ tcp_state_cv

PotrCondVar PotrContext_::tcp_state_cv

切断通知・reconnect sleep の中断用条件変数。

Definition at line 261 of file potrContext.h.

Referenced by potr_connect_thread_stop(), potrCloseService(), potrOpenService(), and reconnect_wait().

◆ tcp_last_ping_recv_ms

volatile uint64_t PotrContext_::tcp_last_ping_recv_ms[POTR_MAX_PATH]

TCP PING 応答最終受信時刻 (ms, CLOCK_MONOTONIC 基準)。path ごと。接続確立時に現在時刻で初期化。

Definition at line 264 of file potrContext.h.

Referenced by receiver_accept_loop(), sender_connect_loop(), tcp_health_thread_func(), and tcp_recv_thread_func().

◆ tcp_last_ping_req_recv_ms

volatile uint64_t PotrContext_::tcp_last_ping_req_recv_ms[POTR_MAX_PATH]

TCP PING 要求最終受信時刻 (ms, CLOCK_MONOTONIC 基準)。path ごと。接続確立時に現在時刻で初期化。

Definition at line 267 of file potrContext.h.

Referenced by receiver_accept_loop(), sender_connect_loop(), and tcp_recv_thread_func().

◆ buf_full_suppress_cnt

int PotrContext_::buf_full_suppress_cnt[POTR_MAX_PATH]

path ごとの送信バッファ満杯ログ抑制カウンタ (0: 抑制なし、1-10: 抑制中)。

Definition at line 270 of file potrContext.h.

Referenced by flush_packed().

◆ session_establish_mutex

PotrMutex PotrContext_::session_establish_mutex

◆ tcp_first_pkt_buf

uint8_t* PotrContext_::tcp_first_pkt_buf[POTR_MAX_PATH]

先読みパケットバッファ (動的確保、PACKET_HEADER_SIZE + max_payload バイト)。

Definition at line 282 of file potrContext.h.

Referenced by potr_connect_thread_start(), potr_connect_thread_stop(), receiver_accept_loop(), and tcp_recv_thread_func().

◆ tcp_first_pkt_len

size_t PotrContext_::tcp_first_pkt_len[POTR_MAX_PATH]

先読みパケットのバイト数 (0: 先読みなし)。

Definition at line 283 of file potrContext.h.

Referenced by potr_connect_thread_start(), potr_connect_thread_stop(), receiver_accept_loop(), and tcp_recv_thread_func().


The documentation for this struct was generated from the following file: