Add ability to change SI channel and detect disconnections

This commit is contained in:
Jack Andersen
2017-01-07 16:51:38 -10:00
parent 4699542f93
commit 0153e0ee6a
3 changed files with 54 additions and 12 deletions

View File

@@ -57,8 +57,7 @@ void Listener::listenerProc()
net::Socket acceptData = {true};
net::Socket acceptClock = {true};
std::string hostname;
u8 chan = 1;
while (m_running && chan < 4)
while (m_running)
{
if (m_dataServer.accept(acceptData, hostname) == net::Socket::EResult::OK)
{
@@ -76,7 +75,7 @@ void Listener::listenerProc()
{
std::unique_lock<std::mutex> lk(m_queueLock);
m_endpointQueue.push(std::make_unique<Endpoint>(
chan++, std::move(acceptData), std::move(acceptClock)));
0, std::move(acceptData), std::move(acceptClock)));
}
WaitGCTicks(GetGCTicksPerSec());
}