RAW mode
Most applications will use sockets in normal, or cooked, mode. This mode provides the full semantics of the protocol. For example, REQ sockets will automatically match a reply to a request, and resend requests periodically if no reply was received.
There are situations, such as with proxies, where it is desirable to bypass these semantics and simply pass messages to and from the socket with no extra semantic handling. This is possible using raw mode sockets.
Raw mode sockets are generally constructed with a different function,
such as nng_req0_open_raw().
Using these sockets, the application can simply send and receive messages,
and is responsible for supplying any additional socket semantics.
Typically this means that the application will need to inspect message
headers on incoming messages, and supply them on outgoing messages.
tip
The nng_device() function only works with raw mode
sockets, but as it only forwards the messages, no additional application
processing is needed.