Fix listen with IPv4 error (#198)

This commit is contained in:
Dennis Schwerdel 2021-05-27 08:16:38 +02:00
parent 4d8286c54c
commit ad75704f7b
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ pub fn parse_listen(addr: &str, default_port: u16) -> SocketAddr {
impl Socket for UdpSocket {
fn listen(addr: &str) -> Result<Self, io::Error> {
let addr = parse_listen(addr, DEFAULT_PORT);
let addr = mapped_addr(parse_listen(addr, DEFAULT_PORT));
UdpSocket::bind(addr)
}
@ -136,7 +136,7 @@ impl AsRawFd for MockSocket {
impl Socket for MockSocket {
fn listen(addr: &str) -> Result<Self, io::Error> {
Ok(Self::new(parse_listen(addr, DEFAULT_PORT)))
Ok(Self::new(mapped_addr(parse_listen(addr, DEFAULT_PORT))))
}
fn receive(&mut self, buffer: &mut MsgBuffer) -> Result<SocketAddr, io::Error> {