mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(net): handle connection removal in WowConnectionNet
This commit is contained in:
parent
84a4ead425
commit
0ca1c8e331
4 changed files with 19 additions and 1 deletions
|
|
@ -35,7 +35,15 @@ void WowConnectionNet::Delete(WowConnection* connection) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WowConnectionNet::Remove(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() {
|
void WowConnectionNet::Run() {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ class WowConnectionNet {
|
||||||
void PlatformAdd(WowConnection* connection);
|
void PlatformAdd(WowConnection* connection);
|
||||||
void PlatformChangeState(WowConnection* connection, WOW_CONN_STATE state);
|
void PlatformChangeState(WowConnection* connection, WOW_CONN_STATE state);
|
||||||
void PlatformInit(bool useEngine);
|
void PlatformInit(bool useEngine);
|
||||||
|
void PlatformRemove(WowConnection* connection);
|
||||||
void PlatformRun();
|
void PlatformRun();
|
||||||
void PlatformWorkerReady();
|
void PlatformWorkerReady();
|
||||||
void Remove(WowConnection* connection);
|
void Remove(WowConnection* connection);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@ void WowConnectionNet::PlatformInit(bool useEngine) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WowConnectionNet::PlatformRemove(WowConnection* connection) {
|
||||||
|
char buf = '\1';
|
||||||
|
write(s_workerPipe[1], &buf, sizeof(buf));
|
||||||
|
}
|
||||||
|
|
||||||
void WowConnectionNet::PlatformRun() {
|
void WowConnectionNet::PlatformRun() {
|
||||||
pipe(s_workerPipe);
|
pipe(s_workerPipe);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ void WowConnectionNet::PlatformInit(bool useEngine) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WowConnectionNet::PlatformRemove(WowConnection* connection) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void WowConnectionNet::PlatformRun() {
|
void WowConnectionNet::PlatformRun() {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue