From 1b825b063da65fe3d88c1ca97afded0d6f6ccc14 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 5 Apr 2024 08:40:25 -0700 Subject: Compat pages converted. --- docs/ref/compat/nn_socket.adoc | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/ref/compat/nn_socket.adoc (limited to 'docs/ref/compat/nn_socket.adoc') diff --git a/docs/ref/compat/nn_socket.adoc b/docs/ref/compat/nn_socket.adoc new file mode 100644 index 00000000..d5e88652 --- /dev/null +++ b/docs/ref/compat/nn_socket.adoc @@ -0,0 +1,54 @@ +## nn_socket + +Create socket (compatible API). + +### Synopsis + +```c +#include + +int nn_socket(int af, int proto); +``` + +### Description + +The `nn_socket` function creates socket using the address family _af_ and +protocol _proto_ and returns it. + +The address family _af_ can be one of two values: + +[horizontal] +`AF_SP`:: Normal socket. +`AF_SP_RAW`:: Raw mode socket. + +The protocol indicates the protocol to be used when creating the socket. +The following protocols are defined: + +[horizontal] +`NN_PAIR`:: xref:nng_pair.adoc[Pair] protocol. +`NN_PUB`:: xref:nng_pub.adoc[Publisher] protocol. +`NN_SUB`:: xref:nng_sub.adoc[Subscriber] protocol. +`NN_REQ`:: xref:nng_req.adoc[Requestor] protocol. +`NN_REP`:: xref:nng_rep.adoc[Replier] protocol. +`NN_PUSH`:: xref:nng_push.adoc[Push] protocol. +`NN_PULL`:: xref:nng_pull.adoc[Pull] protocol. +`NN_SURVEYOR`:: xref:nng_surveyor.adoc[Surveyor] protocol. +`NN_RESPONDENT`:: xref:nng_respondent.adoc[Respondent] protocol. +`NN_BUS`:: xref:nng_bus.adoc[Bus] protocol. + +### Return Values + +This function returns a valid socket number on success, and -1 on failure. + +### Errors + +[horizontal] +`ENOMEM`:: Insufficient memory is available. +`ENOTSUP`:: The protocol is not supported. +`ETERM`:: The library is shutting down. + +### See Also + +xref:nng_socket.adoc[nng_socket], +xref:nn_close.adoc[nn_close], +xref:nn_errno.adoc[nn_errno] \ No newline at end of file -- cgit v1.2.3-70-g09d2