Files
kid 866df1a323 feat: M3 mosh 挂起→恢复<3s(唤醒脉冲 + 会话状态机三相)
- SessionMachine 加 mosh 三相(moshActive/moshParked/moshResuming)+看门狗兜底,
  mosh 接管即拆 SSH、后台冻结不重建、前台唤醒脉冲等 SSP 续(+5 单测)
- bridge.go: Node.WakeUp()(tsnet InjectEvent+MagicSock.Rebind/ReSTUN) +
  MoshRelay.Rebind()(同端口重开 loopback、泵按 socket 生成容错)
- iosclient.cc: g_mosh_last_heard 探针(导出 mosh_last_heard_ms) + SIGCONT 全屏重绘
- MoshSession: nudge()(SIGCONT) + lastHeardMs();SSHTerminalModel 前台脉冲三连
  + healthy 轮询 + beginBackgroundTask;URL scheme 供无头前台唤醒
- 验证(vohive-vm over tsnet):15s 冻结→前台 wake pulse→1.3s recovered,<3s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-24 17:04:33 +08:00

24 lines
895 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* CMosh — Swift 可 import 的 mosh 客户端入口头(库符号来自 MoshCore.xcframework
* 对应 vendor/mosh/src/frontend/moshiosbridge.h保持签名一致。
* mosh_main 是阻塞式主循环:读 f_in(用户输入字节)、写 f_out(终端输出字节)
* 经 UDP 连 ip:portmosh SSPAES-128-OCBwindow_size 供 SIGWINCH resize。 */
#ifndef CMOSH_MOSHIOSBRIDGE_H
#define CMOSH_MOSHIOSBRIDGE_H
#include <stdio.h>
#include <sys/ioctl.h>
#if __cplusplus
extern "C"
#endif
int mosh_main(FILE *f_in, FILE *f_out, struct winsize *window_size,
const char *ip, const char *port, const char *key, const char *predict_mode);
/* M3最近一次收到新服务器状态的 mosh 单调时刻(ms)0=从未。前台恢复判定用。 */
#if __cplusplus
extern "C"
#endif
unsigned long long mosh_last_heard_ms(void);
#endif /* CMOSH_MOSHIOSBRIDGE_H */