NN_BIND(3compat)
okay so this is NN_BIND(3compat) from the NNG Reference Manual, and bestie, itβs giving βlegacy API with main character energyβ π
β¨
π NAME π
nn_bind β accept connections from remote peers (compatible API)
πΈ SYNOPSIS πΈ
#include <nanomsg/nn.h>
int nn_bind(int sock, const char *url)
π¦ DESCRIPTION π¦
The nn_bind() function arranges for the socket sock to accept connections at the address specified by url. An identifier for this socketβs association with the url is returned to the caller on success. This identifier can be used with nn_shutdown() to remove the association later. no cap, thatβs the whole vibe π«Ά
π Note
This function is provided for API compatibility with legacy libnanomsg. Consider using the relevant modern API instead.
π Note
The bind operation is performed asynchronously, and may not have completed before this function returns control to the caller. so like, donβt assume itβs already done the second you get control back, bestie π
β οΈ Important
Only transports supported by legacy libnanomsg may be used with this function. In particular, only the schemes tcp://, ipc://, inproc://, and ws:// are supported with this function. (Use the modern API to use other schemes.) this part is lowkey crucial π₯
π RETURN VALUES π
This function returns a positive identifier on success, and -1 on error. periodt π
π ERRORS π
EADDRINUSEβ The address specified byurlis already in use. somebody else got there first, bestie πEADDRNOTAVAILβ The address specified byurlis not available.EBADFβ The socketsockis not open.EINVALβ An invalidurlwas supplied.
π SEE ALSO π
go peek at these, iykyk:
nn_connect(3compat)nn_errno(3compat)nn_shutdown(3compat)nn_socket(3compat)nn_compat(3compat)nng(7)
thatβs the whole page, bestie β brought to you by the NNG Reference Manual, dated 2026-01-13, and starring NN_BIND(3compat). stay slay and bind responsibly πβ¨
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms