WPILibC++ 2023.4.3
|
Forward ports to another host. More...
#include <wpinet/PortForwarder.h>
Public Member Functions | |
PortForwarder (const PortForwarder &)=delete | |
PortForwarder & | operator= (const PortForwarder &)=delete |
void | Add (unsigned int port, std::string_view 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 PortForwarder & | GetInstance () |
Get an instance of the PortForwarder class. More... | |
Forward ports to another host.
This is primarily useful for accessing Ethernet-connected devices from a computer tethered to the RoboRIO USB port.
|
delete |
void wpi::PortForwarder::Add | ( | unsigned int | port, |
std::string_view | 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.
port | local port number |
remoteHost | remote IP address / DNS name |
remotePort | remote port number |
|
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.
|
delete |
void wpi::PortForwarder::Remove | ( | unsigned int | port | ) |
Stop TCP forwarding on a port.
port | local port number |