mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_udp: improve code for request connection validity checks
This commit is contained in:
parent
03c36f51c9
commit
881579435a
2 changed files with 34 additions and 30 deletions
|
|
@ -36,6 +36,15 @@ pub struct ConnectionKey {
|
|||
pub socket_addr: SocketAddr,
|
||||
}
|
||||
|
||||
impl ConnectionKey {
|
||||
pub fn new(connection_id: ConnectionId, socket_addr: SocketAddr) -> Self {
|
||||
Self {
|
||||
connection_id,
|
||||
socket_addr,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type ConnectionMap = HashMap<ConnectionKey, ValidUntil>;
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue