Creates a device which is a socket forwarder or proxy. Provides for improved horizontal scalability, reliability, and isolation.

device(s1, s2)

Arguments

s1

a raw mode Socket.

s2

a raw mode Socket.

Value

NULL. If the device was successfully created, this function does not return.

Details

Only raw mode sockets may be used with this function. Sockets s1 and s2 must be compatible with each other, i.e. be opposite halves of a two protocol pattern, or both the same protocol for a single protocol pattern.

Usage

Warning: this function is designed to be called in an isolated process with the two sockets. Once called, it will block with no ability to interrupt. To terminate the device, the process must be killed (in interactive sessions this may be done by sending SIGQUIT e.g. ctrl + \).