9#include <daq/dataflow/EvtSocketManager.h>
23 FD_SET(sock->sock(), &m_allset);
24 m_maxfd = sock->sock();
26 m_sock = sock->sock();
29EvtSocketManager::~EvtSocketManager()
33int EvtSocketManager::examine()
35 memcpy(&m_rset, &m_allset,
sizeof(m_rset));
36 memcpy(&m_wset, &m_allset,
sizeof(m_wset));
37 struct timeval timeout;
39 timeout.tv_usec = 1000;
42 int rc = select(m_maxfd + 1, &m_rset, &m_wset, NULL, &timeout);
49 if (FD_ISSET(m_sock, &m_rset)) {
50 int fd = (m_recv->sock())->accept();
52 FD_SET(fd, &m_allset);
53 if (fd > m_maxfd) m_maxfd = fd;
69vector<int>& EvtSocketManager::connected_socket_list()
74bool EvtSocketManager::connected(
int fd,
bool wreq)
77 if (FD_ISSET(fd, &m_rset))
82 if (FD_ISSET(fd, &m_wset))
89bool EvtSocketManager::remove(
int fd)
91 FD_CLR(fd, &m_allset);
92 shutdown(fd, SHUT_RDWR);
94 vector<int>::iterator pos = find(m_fd.begin(), m_fd.end(), fd);
95 if (pos != m_fd.end()) {
Abstract base class for different kinds of events.