ping\_send(3) liboping ping\_send(3)

# [NAME](#NAME)

ping\_send - Send ICMP echo requests to all associated hosts and wait for ICMP echo responses to arrive

# [SYNOPSIS](#SYNOPSIS)

```
  #include <oping.h>
  int ping_send (pingobj_t *obj);
```

# [DESCRIPTION](#DESCRIPTION)

The **ping\_send** method is the actual workhorse of this library. It crafts ICMP packets for the hosts associated with *obj* and sends them via the corresponding sockets. It then waits for echo responses and receives them, writing latency information for each host. The method returns after all echo replies have been read or the timeout (set with [**ping\_setopt**(3)](/man/os/liboping/ping_setopt.3)) is reached.

After this function returns you will most likely iterate over all hosts using [**ping\_iterator\_get**(3)](/man/os/liboping/ping_iterator_get.3) and ping\_iterator\_next (described in the same manual page) and call [**ping\_iterator\_get\_info**(3)](/man/os/liboping/ping_iterator_get_info.3) on each host.

# [RETURN VALUE](#RETURN_VALUE)

**ping\_send** returns the number of echo replies received or a value less than zero if an error occurred. Use [**ping\_get\_error**(3)](/man/os/liboping/ping_get_error.3) to receive an error message.

# [SEE ALSO](#SEE_ALSO)

[**ping\_construct**(3)](/man/os/liboping/ping_construct.3), [**ping\_setopt**(3)](/man/os/liboping/ping_setopt.3), [**ping\_iterator\_get**(3)](/man/os/liboping/ping_iterator_get.3), [**ping\_iterator\_get\_info**(3)](/man/os/liboping/ping_iterator_get_info.3), [**ping\_get\_error**(3)](/man/os/liboping/ping_get_error.3), [**liboping**(3)](/man/os/liboping/liboping.3)

# [AUTHOR](#AUTHOR)

liboping is written by Florian "octo" Forster &lt;ff at octo.it&gt;. Its homepage can be found at &lt;http://noping.cc/&gt;.

Copyright (c) 2006-2017 by Florian "octo" Forster.

2026-08-31 1.10.0

---

Document: ping_send(3) from liboping 1.10.0-r6 (Chainguard OS)
Source: https://github.com/octo/liboping.git
