29#include <sptk5/Exception.h>
30#include <sptk5/net/BaseSocket.h>
31#include <sptk5/threads/Thread.h>
44using SocketEvent = epoll_event;
52using SocketEvent = epoll_event;
57using SocketEvent = kevent;
67enum class SocketEventType : uint8_t
77using SocketEventCallback = std::function<void(uint8_t* userData, SocketEventType eventType)>;
80#define INVALID_EPOLL nullptr
82#define INVALID_EPOLL INVALID_SOCKET
100 explicit SocketPool(
const SocketEventCallback& eventsCallback);
157 HANDLE m_pool {INVALID_EPOLL};
159 SOCKET m_pool {INVALID_EPOLL};
165 SocketEventCallback m_eventsCallback;
170 std::map<BaseSocket*, std::shared_ptr<SocketEvent>> m_socketData;
Definition: BaseSocket.h:87
Definition: SocketPool.h:94
void forgetSocket(BaseSocket &socket)
SocketPool & operator=(const SocketPool &)=delete
void watchSocket(BaseSocket &socket, uint8_t *userData)
SocketPool(const SocketPool &) noexcept=delete
void waitForEvents(std::chrono::milliseconds timeout) const
SocketPool(const SocketEventCallback &eventsCallback)