= nng_ipc(5)
//
// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
// Copyright 2019 Devolutions <info@devolutions.net>
//
// This document is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
// file was obtained (LICENSE.txt).  A copy of the license may also be
// found online at https://opensource.org/licenses/MIT.
//

== NAME

nng_ipc - IPC connection

== SYNOPSIS

[source, c]
----
#include <nng/nng.h>
#include <nng/supplemental/ipc/ipc.h>

typedef struct nng_ipc_s nng_ipc;
----

== DESCRIPTION

An `nng_ipc` (((IPC connection))) represents a connected stream
using interprocess communication (IPC).
IPC stream objects can be used to send or receive data.

NOTE: The `nng_ipc` object is used for raw IPC connections, and
should not be confused with a pipe object created using the
<<nng_ipc.7#,nng_ipc(7)>> transport.

TIP: Most NNG applications should not use this, but instead use the
<<nng_ipc.7#,nng_ipc(7)>> transport instead.

These objects are created either establishing an outgoing connection
with <<nng_ipc_dialer_dial.3ipc#,`nng_ipc_dialer_dial()`>> or by
accepting in incoming connection with
<<nng_ipc_listener_accept.3ipc#,`nng_ipc_listener_accept()`>>.

IPC connections are byte streams, and are "`reliable`" in that data
will not be delivered out of order, or with portions missing.

Data can be sent using <<nng_ipc_send.3ipc#,`nng_ipc_send()`>> or
received with <<nng_ipc_recv.3ipc#,`nng_ipc_recv()`>>.

When the connection is no longer needed, it should be freed with
<<nng_ipc_free.3ipc#,`nng_ipc_free()`>>.

TIP: It is possible to close the connection, without freeing it, by
using <<nng_ipc_close.3ipc#,`nng_ipc_close()`>>.

=== Options

The following options are applicable to IPC connections, and may be
accessed using the <<nng_ipc_getopt.3ipc#,`nng_ipc_getopt()`>> and
<<nng_ipc_setopt.3ipc#,`nng_ipc_setopt()`>> functions.

* <<nng_options.5#NNG_OPT_LOCADDR,`NNG_OPT_LOCADDR`>>
* <<nng_options.5#NNG_OPT_REMADDR,`NNG_OPT_REMADDR`>>
* <<nng_ipc_options.5#NNG_OPT_IPC_PEER_GID,`NNG_OPT_IPC_PEER_GID`>>
* <<nng_ipc_options.5#NNG_OPT_IPC_PEER_PID,`NNG_OPT_IPC_PEER_PID`>>
* <<nng_ipc_options.5#NNG_OPT_IPC_PEER_UID,`NNG_OPT_IPC_PEER_UID`>>
* <<nng_ipc_options.5#NNG_OPT_IPC_PEER_ZONEID,`NNG_OPT_IPC_PEER_ZONEID`>>

Other platform specific options may be available as well.

== SEE ALSO

[.text-left]
<<libnng.3#,libnng(3)>>,
<<nng_ipc_close.3ipc#,nng_ipc_close(3ipc)>>,
<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
<<nng_ipc_free.3ipc#,nng_ipc_free(3ipc)>>,
<<nng_ipc_getopt.3ipc#,nng_ipc_getopt(3ipc)>>,
<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
<<nng_ipc_recv.3ipc#,nng_ipc_recv(3ipc)>>,
<<nng_ipc_send.3ipc#,nng_ipc_send(3ipc)>>,
<<nng_ipc_setopt.3ipc#,nng_ipc_setopt(3ipc)>>,
<<nng_ipc_options.5#,nng_ipc_options(5)>>,
<<nng_options.5#,nng_options(5)>>,
<<nng.7#,nng(7)>>,
<<nng_ipc.7#,nng_ipc(7)>>
