feat: 新增 输出通道2

This commit is contained in:
yarnom 2025-10-29 18:10:34 +08:00
parent 54a9696bbf
commit d92024a145
2 changed files with 3 additions and 12 deletions

View File

@ -95,15 +95,8 @@ public class RtkClusterService implements ApplicationRunner {
String localPath = "127.0.0.1:" + workPort; String localPath = "127.0.0.1:" + workPort;
profile.setInpstr1Path(localPath); profile.setInpstr1Path(localPath);
profile.setOutstr1Path(localPath); profile.setOutstr1Path(localPath);
// Also write outstr2_path from group if present // Set outstr2-path to the same local endpoint as requested
try { profile.setOutstr2Path(localPath);
if (profile.getGroupId() != null && groupMapper != null) {
RtkrcvGroup group = groupMapper.selectById(profile.getGroupId());
if (group != null && group.getOutstr2Path() != null && !group.getOutstr2Path().trim().isEmpty()) {
profile.setOutstr2Path(group.getOutstr2Path().trim());
}
}
} catch (Exception ignore) {}
profileMapper.updateById(profile); profileMapper.updateById(profile);
// 3) Generate config and start rtkrcv // 3) Generate config and start rtkrcv

View File

@ -73,13 +73,11 @@ public class RtkrcvConfigService {
replaced = replaceIfNotBlank(replaced, "outstr2-path", profile.getOutstr2Path()); replaced = replaceIfNotBlank(replaced, "outstr2-path", profile.getOutstr2Path());
// If local tcp endpoints are used (e.g., 127.0.0.1:port), force type to tcpcli // If local tcp endpoints are used (e.g., 127.0.0.1:port), force type to tcpcli
if (looksLikeTcpEndpoint(profile.getInpstr1Path())) { if (looksLikeTcpEndpoint(profile.getInpstr1Path())) {
replaced = replaceValueLine(replaced, "inpstr1-type", "tcpcli");
// relax timeouts to avoid frequent reconnects on local streams
replaced = replaceValueLine(replaced, "misc-timeout", "300000"); replaced = replaceValueLine(replaced, "misc-timeout", "300000");
replaced = replaceValueLine(replaced, "misc-reconnect", "3000"); replaced = replaceValueLine(replaced, "misc-reconnect", "3000");
} }
if (looksLikeTcpEndpoint(profile.getOutstr1Path())) { if (looksLikeTcpEndpoint(profile.getOutstr1Path())) {
replaced = replaceValueLine(replaced, "outstr1-type", "tcpcli"); // Do not force outstr1-type; only relax timeouts for local tcp endpoints
replaced = replaceValueLine(replaced, "misc-timeout", "300000"); replaced = replaceValueLine(replaced, "misc-timeout", "300000");
replaced = replaceValueLine(replaced, "misc-reconnect", "3000"); replaced = replaceValueLine(replaced, "misc-reconnect", "3000");
} }