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.
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.