Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

nng_socket_proto_name - obtain the socket protocol name

Description

       These functions store the protocol name of either the socket s, or its natural peer, in _name.

           Note

           The string value obtained by these functions is statically stored as part of the program text, and
           must not be freed or modified.

           Tip

           These functions should be used in place of the NNG_OPT_PROTONAME and NNG_OPT_PEERNAME options in new
           code.

Errors

       NNG_ECLOSED
           Parameter s does not refer to an open socket.

Name

       nng_socket_proto_name - obtain the socket protocol name

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_NAME(3)

Synopsis

           #include <nng/nng.h>

           int nng_socket_proto_name(nng_socket s, const char **name);
           int nng_socket_peer_name(nng_socket s, const char **name);

See Also