---
name: "rpma_ep_listen"
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_ep_listen"
---

# rpma\_ep\_listen(3)

create a listening endpoint

## NAME

**rpma\_ep\_listen** - create a listening endpoint

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_peer;
      struct rpma_ep;
      int rpma_ep_listen(struct rpma_peer *peer, const char *addr, const char *port,
                      struct rpma_ep **ep_ptr);
```

## DESCRIPTION

**rpma\_ep\_listen**() creates an endpoint and initiates listening for incoming connections using reliable, connection-oriented and message-based (RDMA\_PS\_TCP) QP communication.

## RETURN VALUE

The **rpma\_ep\_listen**() function returns 0 on success or a negative error code on failure. **rpma\_ep\_listen**() does not set \*ep\_ptr value on failure.

## ERRORS

**rpma\_ep\_listen**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - peer, addr, port or ep\_ptr is NULL

- •

  RPMA\_E\_PROVIDER - [**rdma\_create\_event\_channel**(3)](/rdma_create_event_channel/3.md), [**rdma\_create\_id**(3)](/rdma_create_id/3.md), [**rdma\_getaddrinfo**(3)](/rdma_getaddrinfo/3.md), [**rdma\_listen**(3)](/rdma_listen/3.md) failed

- •

  RPMA\_E\_NOMEM - out of memory

## SEE ALSO

[**rpma\_ep\_get\_fd**(3)](/rpma_ep_get_fd/3.md), [**rpma\_ep\_next\_conn\_req**(3)](/rpma_ep_next_conn_req/3.md), [**rpma\_ep\_shutdown**(3)](/rpma_ep_shutdown/3.md), [**rpma\_peer\_new**(3)](/rpma_peer_new/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
