## nng_rep_open

Create rep socket.

### Synopsis

```c
#include <nng/nng.h>
#include <nng/protocol/reqrep0/rep.h>

int nng_rep0_open(nng_socket *s);
int nng_rep0_open_raw(nng_socket *);
```

### Description

The `nng_rep0_open` function creates a xref:../proto/rep.adoc[_REP_] version 0 xref:../sock/index.adoc[socket] and returns it at the location pointed to by _s_.

The `nng_rep0_open_raw` function creates a _REP_ version 0 socket in xref:../sock/raw_mode[raw mode] and returns it at the location pointed to by _s_.

### Return Values

These functions return 0 on success, and non-zero otherwise.

### Errors

[horizontal]
`NNG_ENOMEM`:: Insufficient memory is available.
`NNG_ENOTSUP`:: The protocol is not supported.

### See Also

xref:../proto/rep.adoc[Replier Protocol (_REP_)]
xref:../proto/req.adoc[Requester Protocol (_REQ_)]
