WPILibC++  2020.3.2-60-g3011ebe
wpi::PortForwarder Class Reference

Forward ports to another host. More...

#include <PortForwarder.h>

Public Member Functions

 PortForwarder (const PortForwarder &)=delete
 
PortForwarderoperator= (const PortForwarder &)=delete
 
void Add (unsigned int port, const Twine &remoteHost, unsigned int remotePort)
 Forward a local TCP port to a remote host and port. More...
 
void Remove (unsigned int port)
 Stop TCP forwarding on a port. More...
 

Static Public Member Functions

static PortForwarderGetInstance ()
 Get an instance of the PortForwarder class. More...
 

Detailed Description

Forward ports to another host.

This is primarily useful for accessing Ethernet-connected devices from a computer tethered to the RoboRIO USB port.

Member Function Documentation

◆ Add()

void wpi::PortForwarder::Add ( unsigned int  port,
const Twine remoteHost,
unsigned int  remotePort 
)

Forward a local TCP port to a remote host and port.

Note that local ports less than 1024 won't work as a normal user.

Parameters
portlocal port number
remoteHostremote IP address / DNS name
remotePortremote port number

◆ GetInstance()

static PortForwarder& wpi::PortForwarder::GetInstance ( )
static

Get an instance of the PortForwarder class.

This is a singleton to guarantee that there is only a single instance regardless of how many times GetInstance is called.

◆ Remove()

void wpi::PortForwarder::Remove ( unsigned int  port)

Stop TCP forwarding on a port.

Parameters
portlocal port number

The documentation for this class was generated from the following file: