Skip to content

Commit

Permalink
add: is_active to ServerInfor
Browse files Browse the repository at this point in the history
  • Loading branch information
justRkive committed Sep 21, 2024
1 parent 85d58af commit 5c7c4ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/async_resolver/server_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct ServerInfo {
udp_connection: ClientUDPConnection,
//TCP connection
tcp_connection: ClientTCPConnection,
is_active: bool,
}

impl ServerInfo {
Expand All @@ -36,6 +37,7 @@ impl ServerInfo {
algorithm,
udp_connection,
tcp_connection,
is_active: true,
}
}

Expand All @@ -51,6 +53,7 @@ impl ServerInfo {
algorithm,
udp_connection,
tcp_connection,
is_active: true,
}
}

Expand All @@ -68,6 +71,7 @@ impl ServerInfo {
algorithm,
udp_connection,
tcp_connection,
is_active: true,
}
}

Expand Down Expand Up @@ -154,6 +158,14 @@ impl ServerInfo {
self.tcp_connection = tcp_connection;
}

pub fn is_active(&self) -> bool {
self.is_active
}

pub fn set_active(&mut self, is_active: bool) {
self.is_active = is_active;
}

}

#[cfg(test)]
Expand Down

0 comments on commit 5c7c4ff

Please sign in to comment.