From edd3b6bc34f211bd3d58642d0c69ce1b5bb9dc3b Mon Sep 17 00:00:00 2001 From: gdamore Date: Thu, 9 Oct 2025 01:22:20 +0000 Subject: deploy: 9c834956456924df7c885ab8b79573721acaff5c --- ref/api/pipe.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ref/api/pipe.html') diff --git a/ref/api/pipe.html b/ref/api/pipe.html index 49d703ce..b70e4a11 100644 --- a/ref/api/pipe.html +++ b/ref/api/pipe.html @@ -269,7 +269,7 @@ accurate type checks in functions passing values of this type.

However it is possible to access a pipe when more information about the source of a message is needed, or when more control is required over message delivery.

-

Pipe objects are created by dialers and and listeners.

+

Pipe objects are created by dialers and and listeners.

Initialization

A pipe may be initialized using the macro NNG_PIPE_INITIALIZER before it is opened, to prevent confusion with valid open pipes.

@@ -288,7 +288,7 @@ Otherwise it returns -1.

A pipe is considered valid if it was ever created by the socket. Pipes that are allocated on the stack or statically should be initialized with the macro -NNG_PIPE_INITIALIZER to ensure that they cannot be confused with a valid pipe.

+NNG_PIPE_INITIALIZER to ensure that they cannot be confused with a valid pipe.

Closing a Pipe

nng_err nng_pipe_close(nng_pipe p);
@@ -296,7 +296,7 @@ Pipes that are allocated on the stack or statically should be initialized with t
 

The nng_pipe_close function closes the supplied pipe, p. Messages that have been submitted for sending may be flushed or delivered, depending upon the transport.

-

Further attempts to use the pipe after this call returns will result in NNG_ECLOSED.

+

Further attempts to use the pipe after this call returns will result in NNG_ECLOSED.

@@ -313,7 +313,7 @@ nng_socket nng_pipe_socket(nng_pipe p);

-These functions return the socket, dialer, or listener that created or owns the pipe.

+These functions return the socket, dialer, or listener that created or owns the pipe.

If the pipe was does not have an associated dialer or listener, then the associated will return [NNG_DIALER_INITIALIZER] or [NNG_LISTENER_INITIALIZER], as appropriate, and either [nng_dialer_id] or [nng_listener_id] for the returned object will return -1.

@@ -323,7 +323,7 @@ either [nng_dialer_id] or [nng_listener_id] for the re note

The socket, or the endpoint, returned by these functions may be in the process of closing, -and might not be further usable as a result. (Other functions will result in NNG_ECLOSED.)

+and might not be further usable as a result. (Other functions will result in NNG_ECLOSED.)

Pipe Options

nng_err nng_pipe_get_bool(nng_pipe p, const char *opt, bool *valp);
@@ -349,8 +349,8 @@ referenced by valp.

These functions access an option as a specific type. The transport layer will have details about which options are available, and which type they may be accessed using.

In the case of nng_pipe_get_string, the underlying string may only be valid for as long as the pipe is valid. -Thus, this function can only be safely called in a pipe event callback set up with nng_pipe_notify.

-

The nng_pipe_get_strdup function is like nng_pipe_get_string, but makes a copy into a newly allocated buffer, so that the string must be freed by the caller using nng_strfree.

+Thus, this function can only be safely called in a pipe event callback set up with nng_pipe_notify.

+

The nng_pipe_get_strdup function is like nng_pipe_get_string, but makes a copy into a newly allocated buffer, so that the string must be freed by the caller using nng_strfree.

The nng_pipe_get_strcpy function is also like nng_pipe_get_string, but it makes a copy into a buffer supplied by the caller. The buffer is passed in val, and the size of the buffer is passed in len. The value of len must be large enough to hold the string and the terminating zero byte.

@@ -377,7 +377,7 @@ Each event may have at most one callback registered. Registering a callback implicitly unregisters any previously registered.

The following pipe events are supported:

- +
EventDescription
NNG_PIPE_EV_ADD_PREThis event occurs after a connection and negotiation has completed, but before the pipe is added to the socket. If the pipe is closed (using nng_pipe_close) at this point, the socket will never see the pipe, and no further events will occur for the given pipe.
NNG_PIPE_EV_ADD_PREThis event occurs after a connection and negotiation has completed, but before the pipe is added to the socket. If the pipe is closed (using nng_pipe_close) at this point, the socket will never see the pipe, and no further events will occur for the given pipe.
NNG_PIPE_EV_ADD_POSTThis event occurs after the pipe is fully added to the socket. Prior to this time, it is not possible to communicate over the pipe with the socket.
NNG_PIPE_EV_REM_POSTThis event occurs after the pipe has been removed from the socket. The underlying transport may be closed at this point, and it is not possible communicate using this pipe.
@@ -395,7 +395,7 @@ Doing so would thus result in a deadlock.

tip

-

The callback cb may close a pipe for any reason by simply closing it using nng_pipe_close. +

The callback cb may close a pipe for any reason by simply closing it using nng_pipe_close. For example, this might be done to prevent an unauthorized peer from connecting to the socket, if an authorization check made during NNG_PIPE_EV_ADD_PRE fails.

-- cgit v1.2.3-70-g09d2