Mixe for Privacy and Anonymity in the Internet
CASocketGroupEpoll.cpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2000, The JAP-Team
3
All rights reserved.
4
Redistribution and use in source and binary forms, with or without modification,
5
are permitted provided that the following conditions are met:
6
7
- Redistributions of source code must retain the above copyright notice,
8
this list of conditions and the following disclaimer.
9
10
- Redistributions in binary form must reproduce the above copyright notice,
11
this list of conditions and the following disclaimer in the documentation and/or
12
other materials provided with the distribution.
13
14
- Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
15
may be used to endorse or promote products derived from this software without specific
16
prior written permission.
17
18
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
20
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
22
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
27
*/
28
#include "
StdAfx.h
"
29
#include "
CASocketGroupEpoll.hpp
"
30
#ifdef HAVE_EPOLL
31
CASocketGroupEpoll::CASocketGroupEpoll
(
bool
bWrite)
32
{
33
m_pcsFD_SET
=
new
CAMutex
();
34
m_hEPFD
=epoll_create(
MAX_POLLFD
);
35
m_pEpollEvent
=
new
struct
epoll_event;
36
memset(
m_pEpollEvent
,0,
sizeof
(
struct
epoll_event));
37
m_pEvents
=
new
struct
epoll_event[
MAX_POLLFD
];
38
setPoolForWrite
(bWrite);
39
}
40
41
CASocketGroupEpoll::~CASocketGroupEpoll
()
42
{
43
epoll_close
(
m_hEPFD
);
44
delete
[]
m_pEvents
;
45
m_pEvents
= NULL;
46
delete
m_pEpollEvent
;
47
m_pEpollEvent
= NULL;
48
delete
m_pcsFD_SET
;
49
}
50
51
SINT32
CASocketGroupEpoll::setPoolForWrite
(
bool
bWrite)
52
{
53
if
(bWrite)
54
m_pEpollEvent
->events=EPOLLOUT|EPOLLERR|EPOLLHUP;
55
else
56
m_pEpollEvent
->events=EPOLLIN| EPOLLERR|EPOLLHUP;
57
return
E_SUCCESS
;
58
}
59
#endif
CASocketGroupEpoll.hpp
StdAfx.h
epoll_close
#define epoll_close
Definition:
StdAfx.h:434
MAX_POLLFD
#define MAX_POLLFD
Definition:
StdAfx.h:192
SINT32
signed int SINT32
Definition:
basetypedefs.h:132
CAMutex
Definition:
CAMutex.hpp:36
CASocketGroupEpoll::CASocketGroupEpoll
CASocketGroupEpoll(bool bWrite)
Definition:
CASocketGroupEpoll.cpp:31
CASocketGroupEpoll::m_hEPFD
EPOLL_HANDLE m_hEPFD
Definition:
CASocketGroupEpoll.hpp:220
CASocketGroupEpoll::~CASocketGroupEpoll
~CASocketGroupEpoll()
Definition:
CASocketGroupEpoll.cpp:41
CASocketGroupEpoll::m_pEvents
struct epoll_event * m_pEvents
Definition:
CASocketGroupEpoll.hpp:221
CASocketGroupEpoll::m_pcsFD_SET
CAMutex * m_pcsFD_SET
Definition:
CASocketGroupEpoll.hpp:225
CASocketGroupEpoll::m_pEpollEvent
struct epoll_event * m_pEpollEvent
Definition:
CASocketGroupEpoll.hpp:222
CASocketGroupEpoll::setPoolForWrite
SINT32 setPoolForWrite(bool bWrite)
Definition:
CASocketGroupEpoll.cpp:51
E_SUCCESS
const SINT32 E_SUCCESS
Definition:
errorcodes.hpp:2
Generated on Sat Jul 22 2023 00:20:12 for Mixe for Privacy and Anonymity in the Internet by
1.9.1