mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcore] Always show StartLocal instances as connected (#2462)
This is useful for testing things that check IsConnected().
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -244,6 +244,8 @@ std::vector<ConnectionInfo> DispatcherBase::GetConnections() const {
|
||||
bool DispatcherBase::IsConnected() const {
|
||||
if (!m_active) return false;
|
||||
|
||||
if (m_networkMode == NT_NET_MODE_LOCAL) return true;
|
||||
|
||||
std::scoped_lock lock(m_user_mutex);
|
||||
for (auto& conn : m_connections) {
|
||||
if (conn->state() == NetworkConnection::kActive) return true;
|
||||
|
||||
Reference in New Issue
Block a user