Network/SocketPoller: Fix Linux implementation
Former-commit-id: f709da3636f60638461910570f8a03bf4acd1723 [formerly 8dd3f494efc40f9c652262903642155941620ac4] [formerly f4aeaca88e75efc00d818046d0a6e63a81db5af3 [formerly b5e70d0536e7d25e363b18e58d47122e3c90ca1e]] Former-commit-id: 2ee713e85407fe7d44d3b1352f197da113cbe041 [formerly 9735f9b849062179207f4453a233a851c49431ea] Former-commit-id: fc5e136d0be6123138623ba3d90b64475b8d81b4
This commit is contained in:
parent
a13b17573e
commit
d8788c8d09
|
|
@ -19,6 +19,11 @@ MODULE.OsFiles.Linux = {
|
||||||
"../src/Nazara/Network/Linux/**.cpp"
|
"../src/Nazara/Network/Linux/**.cpp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE.OsFilesExcluded.Linux = {
|
||||||
|
"../src/Nazara/Network/Posix/SocketPollerImpl.hpp",
|
||||||
|
"../src/Nazara/Network/Posix/SocketPollerImpl.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
MODULE.OsLibraries.Windows = {
|
MODULE.OsLibraries.Windows = {
|
||||||
"ws2_32"
|
"ws2_32"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
#include <Nazara/Network/Linux/SocketPollerImpl.hpp>
|
#include <Nazara/Network/Linux/SocketPollerImpl.hpp>
|
||||||
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <Nazara/Network/Debug.hpp>
|
#include <Nazara/Network/Debug.hpp>
|
||||||
|
|
||||||
|
|
@ -44,7 +45,7 @@ namespace Nz
|
||||||
|
|
||||||
if (epoll_ctl(m_handle, EPOLL_CTL_ADD, socket, &event) != 0)
|
if (epoll_ctl(m_handle, EPOLL_CTL_ADD, socket, &event) != 0)
|
||||||
{
|
{
|
||||||
NazaraError("Failed to add socket to epoll structure (errno " String::Number(errno) + ": " + Error::GetLastSystemError() + ')');
|
NazaraError("Failed to add socket to epoll structure (errno " + String::Number(errno) + ": " + Error::GetLastSystemError() + ')');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,7 +62,7 @@ namespace Nz
|
||||||
m_sockets.erase(socket);
|
m_sockets.erase(socket);
|
||||||
|
|
||||||
if (epoll_ctl(m_handle, EPOLL_CTL_DEL, socket, nullptr) != 0)
|
if (epoll_ctl(m_handle, EPOLL_CTL_DEL, socket, nullptr) != 0)
|
||||||
NazaraWarning("An error occured while removing socket from epoll structure (errno " String::Number(errno) + ": " + Error::GetLastSystemError() + ')');
|
NazaraWarning("An error occured while removing socket from epoll structure (errno " + String::Number(errno) + ": " + Error::GetLastSystemError() + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
int SocketPollerImpl::Wait(UInt64 msTimeout, SocketError* error)
|
int SocketPollerImpl::Wait(UInt64 msTimeout, SocketError* error)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||||
#include <Nazara/Network/Win32/SocketPollerImpl.hpp>
|
#include <Nazara/Network/Win32/SocketPollerImpl.hpp>
|
||||||
|
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||||
|
#include <Nazara/Network/Linux/SocketPollerImpl.hpp>
|
||||||
#elif defined(NAZARA_PLATFORM_POSIX)
|
#elif defined(NAZARA_PLATFORM_POSIX)
|
||||||
#include <Nazara/Network/Posix/SocketPollerImpl.hpp>
|
#include <Nazara/Network/Posix/SocketPollerImpl.hpp>
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue