feat: 完成 M2 mosh(LAN + tsnet 端到端验证)
- mosh(blinksh/ios C++)+protobuf-lite 交叉编译为 MoshCore.xcframework (CommonCrypto 后端、含 arm64 模拟器 slice;绕 autotools 用 CMake 直编 + 手写 config.h) - tsnet 桥新增 UDP relay(StartMoshRelay:loopback↔tsnet.Dial 逐包搬运) - MoshSession(pipe↔FILE*/pthread/SIGWINCH)+ MoshConnectScanner(TXCore,+4 单测=39) - SSHTerminalModel 编排:SSH 引导 mosh-server→解析 MOSH CONNECT→relay→mosh 接管 - LAN 直连 + mosh-over-tsnet 均端到端验证通过,R1(tsnet UDP 数据报语义) 证伪 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
47
vendor/protobuf/examples/list_people.dart
vendored
Normal file
47
vendor/protobuf/examples/list_people.dart
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'dart_tutorial/addressbook.pb.dart';
|
||||
import 'dart_tutorial/addressbook.pbenum.dart';
|
||||
|
||||
/// Iterates though all people in the AddressBook and prints info about them.
|
||||
void printAddressBook(AddressBook addressBook) {
|
||||
for (var person in addressBook.people) {
|
||||
print('Person ID: ${person.id}');
|
||||
print(' Name: ${person.name}');
|
||||
if (person.hasEmail()) {
|
||||
print(' E-mail address:${person.email}');
|
||||
}
|
||||
|
||||
for (var phoneNumber in person.phones) {
|
||||
switch (phoneNumber.type) {
|
||||
case Person_PhoneType.MOBILE:
|
||||
print(' Mobile phone #: ');
|
||||
break;
|
||||
case Person_PhoneType.HOME:
|
||||
print(' Home phone #: ');
|
||||
break;
|
||||
case Person_PhoneType.WORK:
|
||||
print(' Work phone #: ');
|
||||
break;
|
||||
default:
|
||||
print(' Unknown phone #: ');
|
||||
break;
|
||||
}
|
||||
print(phoneNumber.number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Reads the entire address book from a file and prints all
|
||||
/// the information inside.
|
||||
void main(List<String> arguments) {
|
||||
if (arguments.length != 1) {
|
||||
print('Usage: list_person ADDRESS_BOOK_FILE');
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Read the existing address book.
|
||||
final file = new File(arguments.first);
|
||||
final addressBook = new AddressBook.fromBuffer(file.readAsBytesSync());
|
||||
printAddressBook(addressBook);
|
||||
}
|
||||
Reference in New Issue
Block a user