logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

nng_socket_proto_id - obtain the socket protocol id

Description

       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.

Errors

       NNG_ECLOSED
           Parameter s does not refer to an open socket.

Name

       nng_socket_proto_id - obtain the socket protocol id

Return Values

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

See Also

nng_socket(5), nng(7)

                                                   2025-04-20                             NNG_SOCKET_PROTO_ID(3)

Synopsis

           #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);

See Also