mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
remove non active web socket clients in keep alive callback (nw)
This commit is contained in:
parent
5f184e36d6
commit
bc0e399730
@ -117,7 +117,8 @@ void *web_engine::websocket_keepalive()
|
|||||||
m_lastupdatetime = curtime;
|
m_lastupdatetime = curtime;
|
||||||
for (simple_list_wrapper<mg_connection> *curitem = m_websockets.first(); curitem != NULL; curitem = curitem->next())
|
for (simple_list_wrapper<mg_connection> *curitem = m_websockets.first(); curitem != NULL; curitem = curitem->next())
|
||||||
{
|
{
|
||||||
mg_websocket_write(curitem->object(), WEBSOCKET_OPCODE_PING, NULL, 0);
|
int status = mg_websocket_write(curitem->object(), WEBSOCKET_OPCODE_PING, NULL, 0);
|
||||||
|
if (status==0) m_websockets.remove(*curitem); // remove inactive clients
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
osd_sleep(osd_ticks_per_second()/5);
|
osd_sleep(osd_ticks_per_second()/5);
|
||||||
|
Loading…
Reference in New Issue
Block a user