fix:增加echo调试代码

This commit is contained in:
liyi 2024-12-23 17:13:32 +08:00
parent eadd667511
commit ffda80fb01
3 changed files with 37 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@ -260,8 +260,6 @@ class ScpMessage {
} else {
throw FormatException("Invalid PayloadLength length");
}
print(
"======================messageId: ${message.MessageId}, spTotal: ${message.SpTotal}, spIndex: ${message.SpIndex}, payloadType: ${message.PayloadType}, payloadLength: ${message.PayloadLength}");
// Payload
if (message.PayloadLength != null &&
@ -532,20 +530,25 @@ class ScpMessage {
_packetBuffer[messageId] = List.filled(spTotal, []);
}
//
if (spIndex < 1 || spIndex > spTotal) {
print('Invalid spIndex: $spIndex for messageId: $messageId');
return null;
}
//
_packetBuffer[messageId]![spIndex - 1] = byte;
//
if (_packetBuffer[messageId]!.every((packet) => packet.isNotEmpty)) {
//
List<int> completePayload =
_packetBuffer[messageId]!.expand((packet) => packet).toList();
List<int> completePayload = _packetBuffer[messageId]!.expand((packet) => packet).toList();
//
_packetBuffer.remove(messageId);
// payload
if (payloadType == PayloadTypeConstant.talkData) {
// payload
final TalkData talkData = TalkData.fromBuffer(completePayload);
return talkData;
} else {

View File

@ -79,7 +79,7 @@ class StartChartManage {
int talkDataIntervalTime = 10; // (ms)
Timer? talkDataTimer; //
final int _maxPayloadSize = 1 * 1024; //
final int _maxPayloadSize = 8 * 1024; //
//
TalkExpect defaultTalkExpect = TalkExpect(
@ -126,6 +126,7 @@ class StartChartManage {
FromPeerId = requestStarChartRegisterNode.peer!.id ?? '';
bindUserStarchart();
}
}
//
@ -946,12 +947,13 @@ class StartChartManage {
///
void destruction() async {
isOnlineStartChartServer = false;
stopTalkExpectMessageTimer();
stopTalkPingMessageTimer();
stopHeartbeat();
stopReStartOnlineStartChartServer();
stopTalkDataTimer();
await Storage.removerRelayInfo();
await Storage.removerStarChartRegisterNodeInfo();
// await Storage.removerRelayInfo();
// await Storage.removerStarChartRegisterNodeInfo();
}
}