---
name: "rpma_conn_next_event"
section: "3"
platform: "linux"
package: "librpma-dev"
version: "1.3.0-2+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rpma_conn_next_event"
---

# rpma\_conn\_next\_event(3)

obtain a connection status

## NAME

**rpma\_conn\_next\_event** - obtain a connection status

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_conn;
      enum rpma_conn_event {
              RPMA_CONN_UNDEFINED = -1,
              RPMA_CONN_ESTABLISHED,
              RPMA_CONN_CLOSED,
              RPMA_CONN_LOST,
              RPMA_CONN_REJECTED,
              RPMA_CONN_UNREACHABLE
      };
      int rpma_conn_next_event(struct rpma_conn *conn,
                      enum rpma_conn_event *event);
```

## DESCRIPTION

**rpma\_conn\_next\_event**() obtains the next event from the connection. Types of events:

- •

  RPMA\_CONN\_UNDEFINED - undefined connection event

- •

  RPMA\_CONN\_ESTABLISHED - connection established

- •

  RPMA\_CONN\_CLOSED - connection closed

- •

  RPMA\_CONN\_LOST - connection lost

- •

  RPMA\_CONN\_REJECTED - connection rejected

- •

  RPMA\_CONN\_UNREACHABLE - connection unreachable

## RETURN VALUE

The **rpma\_conn\_next\_event**() function returns 0 on success or a negative error code on failure.

## ERRORS

**rpma\_conn\_next\_event**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - conn or event is NULL

- •

  RPMA\_E\_UNKNOWN - unexpected event

- •

  RPMA\_E\_PROVIDER - **rdma\_get\_cm\_event**() or **rdma\_ack\_cm\_event**() failed

- •

  RPMA\_E\_NOMEM - out of memory

## SEE ALSO

[**rpma\_conn\_req\_connect**(3)](/rpma_conn_req_connect/3.md), [**rpma\_conn\_disconnect**(3)](/rpma_conn_disconnect/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
