Function cdns_rs::sync::network::new_tcp

source ·
pub fn new_tcp(
    resolver_ip: &IpAddr,
    resolver_port: u16,
    bind_addr: &SocketAddr
) -> CDnsResult<Box<dyn SocketTap>>
Expand description

Creates new instance of TcpStream. The stream is not connected and SocketTap::connect should be called.

§Arguments

  • resolver_ip - a ref to IpAddr which holds host address of the nameserver.

  • resolver_port - a port number binded by nameserver

  • bind_addr - a local address to bind the socket to

§Returns