Is there any way to ping a specific IP address with C?

后端 未结 4 1818
情歌与酒
情歌与酒 2020-12-06 05:35

Is there any way to ping a specific IP address with C? If I wanted to ping \"www.google.com\" with a certain number of pings, or for that matter, a local address, I would ne

4条回答
  •  情书的邮戳
    2020-12-06 06:20

    You would have to learn sockets, resolve the host you want to ping, send the appropiate ICMP packages and listen for a response. There is no ping function in the standard library. However, there are lots of higher level network libraries that already implement the protocol.

提交回复
热议问题