mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[ntcore] Add ability to announce mDNS for server (#8373)
We can use this as a new way of resolving addresses.
This commit is contained in:
@@ -1171,7 +1171,7 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
* @param persistFilename the name of the persist file to use
|
||||
*/
|
||||
public void startServer(String persistFilename) {
|
||||
startServer(persistFilename, "");
|
||||
startServer(persistFilename, "", "");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1181,18 +1181,32 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
* @param listenAddress the address to listen on, or empty to listen on any address
|
||||
*/
|
||||
public void startServer(String persistFilename, String listenAddress) {
|
||||
startServer(persistFilename, listenAddress, kDefaultPort);
|
||||
startServer(persistFilename, listenAddress, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a server using the specified filename, listening address, and port.
|
||||
* Starts a server using the specified filename, listening address, and mdns service,
|
||||
* using the default port.
|
||||
*
|
||||
* @param persistFilename the name of the persist file to use
|
||||
* @param listenAddress the address to listen on, or empty to listen on any address
|
||||
* @param mdnsService the mDNS service name to advertise, or empty to not advertise
|
||||
*/
|
||||
public void startServer(String persistFilename, String listenAddress, String mdnsService) {
|
||||
startServer(persistFilename, listenAddress, mdnsService, kDefaultPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a server using the specified filename, listening address, mdns service and port.
|
||||
*
|
||||
* @param persistFilename the name of the persist file to use
|
||||
* @param listenAddress the address to listen on, or empty to listen on any address
|
||||
* @param mdnsService the mDNS service name to advertise, or empty to not advertise
|
||||
* @param port port to communicate over
|
||||
*/
|
||||
public void startServer(String persistFilename, String listenAddress, int port) {
|
||||
NetworkTablesJNI.startServer(m_handle, persistFilename, listenAddress, port);
|
||||
public void startServer(String persistFilename, String listenAddress, String mdnsService,
|
||||
int port) {
|
||||
NetworkTablesJNI.startServer(m_handle, persistFilename, listenAddress, mdnsService, port);
|
||||
}
|
||||
|
||||
/** Stops the server if it is running. */
|
||||
|
||||
@@ -1404,10 +1404,11 @@ public final class NetworkTablesJNI {
|
||||
* @param inst NT instance handle.
|
||||
* @param persistFilename the name of the persist file to use
|
||||
* @param listenAddress the address to listen on, or empty to listen on any address
|
||||
* @param mdnsService the mDNS service name to advertise, or empty to not advertise
|
||||
* @param port port to communicate over
|
||||
*/
|
||||
public static native void startServer(
|
||||
int inst, String persistFilename, String listenAddress, int port);
|
||||
int inst, String persistFilename, String listenAddress, String mdnsService, int port);
|
||||
|
||||
/**
|
||||
* Stops the server if it is running.
|
||||
|
||||
Reference in New Issue
Block a user