nng_socket_proto_id(3)

nng_socket_proto_id3

Obtain the socket protocol id

Usage

#include <nng/nng.h>
int nng_socket_proto_id(nng_socket s, uint16_t *id);
int nng_socket_peer_id(nng_socket s, uint16_t *id);

Overview

These functions store the 16-bit protocol identifier of either the socket s, or its natural peer, in id.

Tip

These functions should be used in place of the NNG_OPT_PROTO and NNG_OPT_PEER options in new code.

Return values

These functions return zero on success, or an error if the socket is invalid.

Errors

NNG_ECLOSED

Parameter s does not refer to an open socket.

From libnng-dev 1.10.1-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.