---
name: "nng_msg_set_pipe"
section: "3"
platform: "linux"
package: "libnng-dev"
version: "1.10.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nng_msg_set_pipe"
---

# nng\_msg\_set\_pipe(3)

set pipe for message

## NAME

nng\_msg\_set\_pipe - set pipe for message

## SYNOPSIS

```
#include <nng/nng.h>
void nng_msg_set_pipe(nng_msg *msg, nng_pipe p);
```

## DESCRIPTION

The `nng_msg_set_pipe()` sets the pipe associated with message *m* to *p*. This is most often useful when used with protocols that support directing a message to a specific peer. For example the *pair* version 1 protocol can do this when `NNG_OPT_PAIR1_POLY` mode is set.

**Note**\

Not all protocols support overriding the destination pipe.

## RETURN VALUES

None.

## ERRORS

None.

## SEE ALSO

[nng\_msg\_alloc(3)](/nng_msg_alloc/3.md), [nng\_msg\_get\_pipe(3)](/nng_msg_get_pipe/3.md), [nng\_pipe\_getopt(3)](/nng_pipe_getopt/3.md), [nng\_msg(5)](/nng_msg/5.md), [nng(7)](/nng/7.md)
