mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 22:06:06 +03:00
chore(net): use proper FD_SET and FD_ZERO macros
This commit is contained in:
parent
547a5e85a8
commit
bca4f0bbeb
@ -49,9 +49,12 @@ void WowConnectionNet::PlatformRun() {
|
|||||||
while (!this->m_stop) {
|
while (!this->m_stop) {
|
||||||
timeval timeout = { 30, 0 };
|
timeval timeout = { 30, 0 };
|
||||||
|
|
||||||
fd_set readFds = {};
|
fd_set readFds;
|
||||||
fd_set writeFds = {};
|
FD_ZERO(&readFds);
|
||||||
fd_set errorFds = {};
|
fd_set writeFds;
|
||||||
|
FD_ZERO(&writeFds);
|
||||||
|
fd_set errorFds;
|
||||||
|
FD_ZERO(&errorFds);
|
||||||
|
|
||||||
readFds.fds_bits[s_workerPipe[0] >> 5] |= 1 << (s_workerPipe[0] & 0x1F);
|
readFds.fds_bits[s_workerPipe[0] >> 5] |= 1 << (s_workerPipe[0] & 0x1F);
|
||||||
|
|
||||||
@ -69,8 +72,8 @@ void WowConnectionNet::PlatformRun() {
|
|||||||
|
|
||||||
switch (connection->m_connState) {
|
switch (connection->m_connState) {
|
||||||
case WOWC_CONNECTING: {
|
case WOWC_CONNECTING: {
|
||||||
errorFds.fds_bits[connection->m_sock >> 5] |= 1 << (connection->m_sock & 0x1F);
|
FD_SET(connection->m_sock, &writeFds);
|
||||||
writeFds.fds_bits[connection->m_sock >> 5] |= 1 << (connection->m_sock & 0x1F);
|
FD_SET(connection->m_sock, &errorFds);
|
||||||
|
|
||||||
connections.Add(1, &connection);
|
connections.Add(1, &connection);
|
||||||
connection->AddRef();
|
connection->AddRef();
|
||||||
@ -80,7 +83,7 @@ void WowConnectionNet::PlatformRun() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WOWC_LISTENING: {
|
case WOWC_LISTENING: {
|
||||||
readFds.fds_bits[connection->m_sock >> 5] |= 1 << (connection->m_sock & 0x1F);
|
FD_SET(connection->m_sock, &readFds);
|
||||||
|
|
||||||
connections.Add(1, &connection);
|
connections.Add(1, &connection);
|
||||||
connection->AddRef();
|
connection->AddRef();
|
||||||
@ -90,8 +93,8 @@ void WowConnectionNet::PlatformRun() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WOWC_CONNECTED: {
|
case WOWC_CONNECTED: {
|
||||||
readFds.fds_bits[connection->m_sock >> 5] |= 1 << (connection->m_sock & 0x1F);
|
FD_SET(connection->m_sock, &readFds);
|
||||||
errorFds.fds_bits[connection->m_sock >> 5] |= 1 << (connection->m_sock & 0x1F);
|
FD_SET(connection->m_sock, &errorFds);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user