mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +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:
@@ -39,7 +39,7 @@ class ConnectionListenerTest {
|
||||
|
||||
/** Connect to the server. */
|
||||
private void connect(int port) {
|
||||
m_serverInst.startServer("connectionlistenertest.json", "127.0.0.1", port);
|
||||
m_serverInst.startServer("connectionlistenertest.json", "127.0.0.1", "", port);
|
||||
m_clientInst.startClient("client");
|
||||
m_clientInst.setServer("127.0.0.1", port);
|
||||
|
||||
@@ -113,7 +113,7 @@ class ConnectionListenerTest {
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"127.0.0.1", "127.0.0.1 ", " 127.0.0.1 "})
|
||||
void testThreaded(String address) {
|
||||
m_serverInst.startServer("connectionlistenertest.json", address, threadedPort);
|
||||
m_serverInst.startServer("connectionlistenertest.json", address, "", threadedPort);
|
||||
List<NetworkTableEvent> events = new ArrayList<>();
|
||||
final int handle =
|
||||
m_serverInst.addConnectionListener(
|
||||
|
||||
@@ -37,7 +37,7 @@ class TimeSyncTest {
|
||||
try (var poller = new NetworkTableListenerPoller(m_inst)) {
|
||||
poller.addTimeSyncListener(false);
|
||||
|
||||
m_inst.startServer("timesynctest.json", "127.0.0.1", 10030);
|
||||
m_inst.startServer("timesynctest.json", "127.0.0.1", "", 10030);
|
||||
var offset = m_inst.getServerTimeOffset();
|
||||
assertTrue(offset.isPresent());
|
||||
assertEquals(0L, offset.getAsLong());
|
||||
|
||||
@@ -33,7 +33,7 @@ class TopicListenerTest {
|
||||
}
|
||||
|
||||
private void connect() {
|
||||
m_serverInst.startServer("topiclistenertest.json", "127.0.0.1", 10010);
|
||||
m_serverInst.startServer("topiclistenertest.json", "127.0.0.1", "", 10010);
|
||||
m_clientInst.startClient("client");
|
||||
m_clientInst.setServer("127.0.0.1", 10010);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class ConnectionListenerTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
void ConnectionListenerTest::Connect(const char* address, unsigned int port4) {
|
||||
wpi::nt::StartServer(server_inst, "connectionlistenertest.ini", address,
|
||||
wpi::nt::StartServer(server_inst, "connectionlistenertest.ini", address, "",
|
||||
port4);
|
||||
wpi::nt::StartClient(client_inst, "client");
|
||||
wpi::nt::SetServer(client_inst, address, port4);
|
||||
|
||||
@@ -26,7 +26,7 @@ TEST_F(TimeSyncTest, TestServer) {
|
||||
wpi::nt::NetworkTableListenerPoller poller{m_inst};
|
||||
poller.AddTimeSyncListener(false);
|
||||
|
||||
m_inst.StartServer("timesynctest.json", "127.0.0.1", 10030);
|
||||
m_inst.StartServer("timesynctest.json", "127.0.0.1", "", 10030);
|
||||
auto offset = m_inst.GetServerTimeOffset();
|
||||
ASSERT_TRUE(offset);
|
||||
ASSERT_EQ(0, *offset);
|
||||
|
||||
@@ -52,7 +52,7 @@ class TopicListenerTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
void TopicListenerTest::Connect(unsigned int port) {
|
||||
wpi::nt::StartServer(m_serverInst, "topiclistenertest.json", "127.0.0.1",
|
||||
wpi::nt::StartServer(m_serverInst, "topiclistenertest.json", "127.0.0.1", "",
|
||||
port);
|
||||
wpi::nt::StartClient(m_clientInst, "client");
|
||||
wpi::nt::SetServer(m_clientInst, "127.0.0.1", port);
|
||||
|
||||
Reference in New Issue
Block a user