Package edu.wpi.first.net
Class WPINetJNI
java.lang.Object
edu.wpi.first.net.WPINetJNI
WPINet JNI.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Sets whether JNI should be loaded in the static block. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPortForwarder
(int port, String remoteHost, int remotePort) Forward a local TCP port to a remote host and port.static int
createMulticastServiceAnnouncer
(String serviceName, String serviceType, int port, String[] keys, String[] values) Creates a MulticastServiceAnnouncer.static int
createMulticastServiceResolver
(String serviceType) Creates a MulticastServiceResolver.static void
Force load the library.static void
freeMulticastServiceAnnouncer
(int handle) Frees a MulticastServiceAnnouncer.static void
freeMulticastServiceResolver
(int handle) Frees MulticastServiceResolver.static boolean
getMulticastServiceAnnouncerHasImplementation
(int handle) Returns true if MulticastServiceAnnouncer has an implementation.static ServiceData[]
getMulticastServiceResolverData
(int handle) Returns service data for MulticastServiceResolver.static int
getMulticastServiceResolverEventHandle
(int handle) Returns event handle for MulticastServiceResolver.static boolean
getMulticastServiceResolverHasImplementation
(int handle) Returns true if MulticastServiceResolver has an implementation.static void
removePortForwarder
(int port) Stop TCP forwarding on a port.static void
startMulticastServiceAnnouncer
(int handle) Starts MulticastServiceAnnouncer.static void
startMulticastServiceResolver
(int handle) Starts MulticastServiceResolver.static void
startWebServer
(int port, String path) Create a web server at the given port.static void
stopMulticastServiceAnnouncer
(int handle) Stops MulticastServiceAnnouncer.static void
stopMulticastServiceResolver
(int handle) Stops MulticastServiceResolver.static void
stopWebServer
(int port) Stop web server running at the given port.
-
Method Details
-
forceLoad
Force load the library.- Throws:
IOException
- if the library failed to load
-
addPortForwarder
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:
port
- local port numberremoteHost
- remote IP address / DNS nameremotePort
- remote port number
-
removePortForwarder
Stop TCP forwarding on a port.- Parameters:
port
- local port number
-
startWebServer
Create a web server at the given port. Note that local ports less than 1024 won't work as a normal user.- Parameters:
port
- local port numberpath
- local path to document root
-
stopWebServer
Stop web server running at the given port.- Parameters:
port
- local port number
-
createMulticastServiceAnnouncer
public static int createMulticastServiceAnnouncer(String serviceName, String serviceType, int port, String[] keys, String[] values) Creates a MulticastServiceAnnouncer.- Parameters:
serviceName
- service nameserviceType
- service typeport
- portkeys
- keysvalues
- values- Returns:
- MulticastServiceAnnouncer handle.
-
freeMulticastServiceAnnouncer
Frees a MulticastServiceAnnouncer.- Parameters:
handle
- MulticastServiceAnnouncer handle.
-
startMulticastServiceAnnouncer
Starts MulticastServiceAnnouncer.- Parameters:
handle
- MulticastServiceAnnouncer handle.
-
stopMulticastServiceAnnouncer
Stops MulticastServiceAnnouncer.- Parameters:
handle
- MulticastServiceAnnouncer handle.
-
getMulticastServiceAnnouncerHasImplementation
Returns true if MulticastServiceAnnouncer has an implementation.- Parameters:
handle
- MulticastServiceAnnouncer handle.- Returns:
- True if MulticastServiceAnnouncer has an implementation.
-
createMulticastServiceResolver
Creates a MulticastServiceResolver.- Parameters:
serviceType
- Service type.- Returns:
- MulticastServiceResolver handle.
-
freeMulticastServiceResolver
Frees MulticastServiceResolver.- Parameters:
handle
- MulticastServiceResolver handle.
-
startMulticastServiceResolver
Starts MulticastServiceResolver.- Parameters:
handle
- MulticastServiceResolver handle.
-
stopMulticastServiceResolver
Stops MulticastServiceResolver.- Parameters:
handle
- MulticastServiceResolver handle.
-
getMulticastServiceResolverHasImplementation
Returns true if MulticastServiceResolver has an implementation.- Parameters:
handle
- MulticastServiceResolver handle.- Returns:
- True if MulticastServiceResolver has an implementation.
-
getMulticastServiceResolverEventHandle
Returns event handle for MulticastServiceResolver.- Parameters:
handle
- MulticastServiceResolver handle.- Returns:
- Event handle for MulticastServiceResolver.
-
getMulticastServiceResolverData
Returns service data for MulticastServiceResolver.- Parameters:
handle
- MulticastServiceResolver handle.- Returns:
- Service data for MulticastServiceResolver.
-