added start_with_feedback and start_without_feedback's network_code

This commit is contained in:
alex 2025-10-22 16:35:18 +08:00
parent d9b1329e6a
commit df06803004

View File

@ -185,8 +185,9 @@ impl Node {
self.nat_type.lock().unwrap().clone() self.nat_type.lock().unwrap().clone()
} }
pub async fn start_without_feedback(&self, token: String) -> Result<()> { pub async fn start_without_feedback(&self, token: String, network_code: String) -> Result<()> {
*self._token.lock().unwrap() = token; *self._token.lock().unwrap() = token;
*self.network_code.lock().unwrap() = network_code;
let _ = self let _ = self
.start_stop_sender .start_stop_sender
.send(StartStopInfo { .send(StartStopInfo {
@ -200,9 +201,11 @@ impl Node {
pub async fn start_with_feedback( pub async fn start_with_feedback(
&self, &self,
token: String, token: String,
network_code: String,
timeout: Duration, timeout: Duration,
) -> Result<RegisterSuperFeedback> { ) -> Result<RegisterSuperFeedback> {
*self._token.lock().unwrap() = token; *self._token.lock().unwrap() = token;
*self.network_code.lock().unwrap() = network_code;
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
let id = self.get_next_packet_id(); let id = self.get_next_packet_id();
self.packet_id_match.insert(id, tx); self.packet_id_match.insert(id, tx);