passthrough

General-purpose proxy driver. More...

General-purpose proxy driver.

The passthrough driver relays packets between two player interfaces. It connects as a client to an interface, and offers the same interface to other clients. All communication packets are forwarded between the two.

This is specially useful to aggregate many player devices in a single Player Server, and control them using only one connection. Probably the most useful usage is to have a Player Server offering a stable set of interfaces, that get forwarded to the appropriate Player Servers connected to the hardware. If a device is moved around to a different computer, the clients don't have to be reconfigured, since the change is done only in the server running the passthrough driver.

The passthrough driver is also able to change its remote address at runtime. To do this set the connect property to 0, and then change as needed the remote_host, remote_port and remote_index properties. When you set connect to 1, it will connect to the new address. Setting connect to -1 will trigger a disconnect followed by a connect allowing for seamless transfer to a new remote device.

Subscribed clients will have all requests nack'd while the driver is disconnected.

Compile-time dependencies
Provides
Requires
Configuration requests
Configuration file options

The passthrough driver can be used with local or remote interfaces using the requires section in the configuration file.

For local interfaces, the format is:

 driver
 (
 name "passthrough"
 requires ["interface:index"]  // example: ["dio:0"]
 provides ["interface:anotherindex"] // example: ["dio:25"]
 )
 

To connect to an interface running on another server, the format is:

 driver
 (
 name "passthrough"
 requires [":hostname:port:interface:index"]   // example: [":someserver:6665:dio:0"]
 provides ["interface:someindex"] //example: [dio:0]
 )
 

Note that the in the case of connecting to remote interfaces, the provided interface can have any index number. The driver changes the header accordingly.

Author:
Toby Collett (Inro Technologies) (Original version: Alexis Maldonado)