NetworkConnection: Ignore duplicate Start() calls.

This commit is contained in:
Peter Johnson
2015-07-14 23:15:30 -07:00
committed by Peter Johnson
parent 4d3fb3c497
commit beb92e6cbf

View File

@@ -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);