FactbirdHQ / ublox-short-range-rs

A driver crate for the entire u-blox short range family in Rust
6 stars 2 forks source link

fix: EdmEvent connectEvent insert channel only for event protocol type #70

Closed KennethKnudsen97 closed 1 year ago

KennethKnudsen97 commented 1 year ago

When receiving an Ipv4ConnectEvent we have a for loop that goes through each socket and updates the socketmap. The function TcpSocket::downcast(s) only take in a TCP socket and UdpSocket::downcast(s) only takes in UPD socket. We had a problem because we didn't check what type of protocol the socket in Sockets was. This resulted in passing a TCP socket to UdpSocket::downcast(s). The same thing could happen the other way around.