mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-19 03:20:11 +03:00
feat(net): handle connection removal in WowConnectionNet
This commit is contained in:
parent
84a4ead425
commit
0ca1c8e331
@ -35,7 +35,15 @@ void WowConnectionNet::Delete(WowConnection* connection) {
|
||||
}
|
||||
|
||||
void WowConnectionNet::Remove(WowConnection* connection) {
|
||||
// TODO
|
||||
this->m_connectionsLock.Enter();
|
||||
|
||||
if (this->m_connections.IsLinked(connection)) {
|
||||
this->m_connections.UnlinkNode(connection);
|
||||
}
|
||||
|
||||
this->PlatformRemove(connection);
|
||||
|
||||
this->m_connectionsLock.Leave();
|
||||
}
|
||||
|
||||
void WowConnectionNet::Run() {
|
||||
|
@ -42,6 +42,7 @@ class WowConnectionNet {
|
||||
void PlatformAdd(WowConnection* connection);
|
||||
void PlatformChangeState(WowConnection* connection, WOW_CONN_STATE state);
|
||||
void PlatformInit(bool useEngine);
|
||||
void PlatformRemove(WowConnection* connection);
|
||||
void PlatformRun();
|
||||
void PlatformWorkerReady();
|
||||
void Remove(WowConnection* connection);
|
||||
|
@ -31,6 +31,11 @@ void WowConnectionNet::PlatformInit(bool useEngine) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void WowConnectionNet::PlatformRemove(WowConnection* connection) {
|
||||
char buf = '\1';
|
||||
write(s_workerPipe[1], &buf, sizeof(buf));
|
||||
}
|
||||
|
||||
void WowConnectionNet::PlatformRun() {
|
||||
pipe(s_workerPipe);
|
||||
|
||||
|
@ -14,6 +14,10 @@ void WowConnectionNet::PlatformInit(bool useEngine) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void WowConnectionNet::PlatformRemove(WowConnection* connection) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void WowConnectionNet::PlatformRun() {
|
||||
// TODO
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user