Skip to content

Commit 106244b

Browse files
committed
Fix build for Mac. Tweak the latency colors.
1 parent 17f9684 commit 106244b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Common/Cpp/Sockets/ClientSocket_POSIX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <fcntl.h>
1818
#include <netinet/in.h>
1919
#include <arpa/inet.h>
20+
#include <unistd.h>
2021
#include "AbstractClientSocket.h"
2122

2223
namespace PokemonAutomation{

SerialPrograms/Source/NintendoSwitch/Controllers/SysbotBase/SysbotBase_Connection.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void TcpSysbotBase_Connection::thread_loop(){
135135
std::string str = "Response Time: " + pretty_print(latency.count()) + " ms";
136136
if (latency < 10ms){
137137
set_status(html_color_text(m_version + str, COLOR_BLUE));
138-
}else if (latency < 20ms){
138+
}else if (latency < 50ms){
139139
set_status(html_color_text(m_version + str, COLOR_ORANGE));
140140
}else{
141141
set_status(html_color_text(m_version + str, COLOR_RED));
@@ -182,9 +182,10 @@ void TcpSysbotBase_Connection::on_connect_finished(const std::string& error_mess
182182
}catch (...){}
183183
}
184184
void TcpSysbotBase_Connection::on_receive_data(const void* data, size_t bytes){
185+
WallClock now = current_time();
185186
std::lock_guard<std::mutex> lg(m_lock);
186187
try{
187-
m_last_receive = current_time();
188+
m_last_receive = now;
188189
// cout << "sys-botbase Response: " << std::string((const char*)data, bytes) << endl;
189190

190191
if (m_version.empty()){

0 commit comments

Comments
 (0)