// ListenIP listens for incoming IP packets addressed to the
// local address laddr.  The returned connection c's ReadFrom
// and WriteTo methods can be used to receive and send IP
// packets with per-packet addressing.
ListenIP listens for incoming IP packets addressed to the
local address laddr.  The returned connection c's ReadFrom
and WriteTo methods can be used to receive and send IP
packets with per-packet addressing.
// ListenIP listens for incoming IP packets addressed to the // local address laddr . The returned connection c ' s ReadFrom // and WriteTo methods can be used to receive and send IP // packets with per - packet addressing .
func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) {
	net, proto, err := parseDialNetwork(netProto)
	if err != nil {
		return nil, err
	}
	switch net {
	case "ip", "ip4", "ip6":
	default:
		return nil, UnknownNetworkError(net)
	}
	fd, err := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_RAW, proto, "listen", sockaddrToIP)
	if err != nil {
		return nil, err
	}
	return newIPConn(fd), nil
}
func ListenIP ( netProto string , laddr * IPAddr ) ( * IPConn , error ) { net , proto , err := parseDialNetwork ( netProto ) if err != nil { return nil , err } switch net { case " " , " " , " " : default : return nil , UnknownNetworkError ( net ) } fd , err := internetSocket ( net , laddr . toAddr ( ) , nil , syscall . SOCK_RAW , proto , " " , sockaddrToIP ) if err != nil { return nil , err } return newIPConn ( fd ) , nil }
ListenIP listens for incoming IP packets addressed to the
local address laddr.
ListenIP listens for incoming IP packets addressed to the local address laddr .