minor clean-ups

This commit is contained in:
Doug Hoyte
2023-04-29 14:38:24 -04:00
parent 0aae8323b6
commit 70c0edc350
4 changed files with 9 additions and 11 deletions

View File

@ -25,8 +25,7 @@ class WSConnection {
std::function<void()> onTrigger;
bool reconnect = true;
uint64_t reconnectDelayMilliseconds = 5'000;
// bortloff@github needed an address to work with here, for his stream writepolicy hack
std::string connected_addr;
std::string remoteAddr;
// Should only be called from the websocket thread (ie within an onConnect or onMessage callback)
void send(std::string_view msg, uWS::OpCode op = uWS::OpCode::TEXT, size_t *compressedSize = nullptr) {
@ -59,9 +58,8 @@ class WSConnection {
currWs = nullptr;
}
std::string addr = ws->getAddress().address;
LI << "Connected to " << addr;
connected_addr = addr;
remoteAddr = ws->getAddress().address;
LI << "Connected to " << remoteAddr;
{
int optval = 1;