6 #ifndef _INC_cNetSocketSet_H
7 #define _INC_cNetSocketSet_H
56 CopySockets(&nss.
m_fds);
62 void operator = (
const fd_set* pfds)
68 CopySockets(&nss.
m_fds);
74 memcpy(&m_fds, pfds,
sizeof(m_fds));
77 bool AddSocket(SOCKET hSocket);
78 void RemoveSocket(SOCKET hSocket);
83 if (hSocket == INVALID_SOCKET)
85 return FD_ISSET(hSocket, &m_fds) ? true :
false;
97 return m_fds.fd_count;
99 return FD_SETSIZE + 1;
106 m_fds.fd_count = iCount;
114 operator const fd_set*()
const
119 static int GRAYCALL Select(fd_set* pReadSet, fd_set* pWriteSet =
nullptr, fd_set* pExceptSet =
nullptr,
const cTimeVal* pTimeout =
nullptr);
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
Definition: cNetSocketSet.h:18
cNetSocketSet(const cNetSocketSet &nss)
Definition: cNetSocketSet.h:52
void put_NFDS(int iCount) noexcept
Definition: cNetSocketSet.h:102
cNetSocketSet(const fd_set *pfds)
Definition: cNetSocketSet.h:46
int get_NFDS() const noexcept
Definition: cNetSocketSet.h:92
static const int k_nSocketSetSize
= FD_SETSIZE. Max number of sockets i can add to this array.
Definition: cNetSocketSet.h:26
void CopySockets(const fd_set *pfds)
Definition: cNetSocketSet.h:71
cNetSocketSet()
Definition: cNetSocketSet.h:30
cNetSocketSet(SOCKET hSocket)
Definition: cNetSocketSet.h:34
~cNetSocketSet()
Definition: cNetSocketSet.h:58
void ClearSockets() noexcept
Definition: cNetSocketSet.h:87
fd_set m_fds
array of FD_SETSIZE possible SOCKET(s). NOTE: sizeof(m_fds) varies with FD_SETSIZE
Definition: cNetSocketSet.h:27
bool IsSocketSet(SOCKET hSocket) const
Definition: cNetSocketSet.h:80
cNetSocketSet(const cNetSocket &socket)
Definition: cNetSocketSet.h:40
Definition: cNetSocket.h:185
SOCKET get_HSocket() const noexcept
Definition: cNetSocket.h:340
Definition: cTimeVal.h:20