forked from barchart/barchart-udt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a63264
commit 83a70e8
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
### Interest set | ||
|
||
int CEPoll::add_usock(const int eid, const UDTSOCKET& u, const int* events) | ||
int CEPoll::remove_usock(const int eid, const UDTSOCKET& u) | ||
* only change presence of interest | ||
|
||
int CEPoll::update_events(const UDTSOCKET& uid, std::set<int>& eids, int events, bool enable) | ||
* only update result if interest present | ||
|
||
int CEPoll::wait(const int eid, set<UDTSOCKET>* readfds, set<UDTSOCKET>* writefds, int64_t msTimeOut, set<SYSSOCKET>* lrfds, set<SYSSOCKET>* lwfds) | ||
* report result regardless if interest is present | ||
|
||
``` | ||
m_mPolls(poll-id) -> m_sUDTSocksIn(socket-id) | ||
m_mPolls(poll-id) -> m_sUDTSocksOut(socket-id) | ||
m_mPolls(poll-id) -> m_sUDTSocksEx(socket-id) | ||
``` | ||
|
||
### Result set | ||
|
||
void CUDT::addEPoll(const int eid) | ||
* add only UDT_EPOLL_IN UDT_EPOLL_OUT | ||
* insert into result if interest is present and has matching state | ||
|
||
void CUDT::removeEPoll(const int eid) | ||
* remove only UDT_EPOLL_IN UDT_EPOLL_OUT | ||
* erase from result | ||
|
||
int CEPoll::update_events(const UDTSOCKET& uid, std::set<int>& eids, int events, bool enable) | ||
* only update result if interest present | ||
|
||
int CEPoll::wait(const int eid, set<UDTSOCKET>* readfds, set<UDTSOCKET>* writefds, int64_t msTimeOut, set<SYSSOCKET>* lrfds, set<SYSSOCKET>* lwfds) | ||
* report result regardless if interest is present | ||
|
||
``` | ||
m_mPolls(poll-id) -> m_sUDTReads(socket-id) | ||
m_mPolls(poll-id) -> m_sUDTWrites(socket-id) | ||
m_mPolls(poll-id) -> m_sUDTExcepts(socket-id) | ||
``` | ||
|
||
### Epoll state in result | ||
|
||
UDT_EPOLL_ERR | ||
* is only set | ||
* never cleared | ||
* socket must be closed | ||
|