The default mode 'serial' sends serialised R objects to ensure perfect
reproducibility within R. When receiving, the corresponding mode 'serial'
should be used.
Mode 'raw' sends atomic vectors of any type as a raw byte vector, and
must be used when interfacing with external applications or raw system
sockets, where R serialization is not in use. When receiving, the mode
corresponding to the vector sent should be used.
Mode 'next' sends serialised R objects, with native extensions enabled by
nextmode
. This allows 'refhook' functions to be registered
for custom serialization and unserialization of reference objects, such
as those accessed via an external pointer. When receiving, mode 'serial'
should be used as 'next' sends are fully compatible.