Fix listen with IPv4 error (#198)

pull/200/head
Dennis Schwerdel 2 years ago
parent 4d8286c54c
commit ad75704f7b
  1. 4
      src/net.rs

@ -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> {

Loading…
Cancel
Save