mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
NetworkConnection: Ignore duplicate Start() calls.
This commit is contained in:
committed by
Peter Johnson
parent
4d3fb3c497
commit
beb92e6cbf
@@ -27,6 +27,7 @@ NetworkConnection::NetworkConnection(std::unique_ptr<TCPStream> stream,
|
||||
NetworkConnection::~NetworkConnection() { Stop(); }
|
||||
|
||||
void NetworkConnection::Start() {
|
||||
if (m_active) return;
|
||||
m_active = true;
|
||||
m_write_thread = std::thread(&NetworkConnection::WriteThreadMain, this);
|
||||
m_read_thread = std::thread(&NetworkConnection::ReadThreadMain, this);
|
||||
|
||||
Reference in New Issue
Block a user