Skip to content

Commit

Permalink
document epoll
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei-Pozolotin committed May 12, 2013
1 parent 2a63264 commit 83a70e8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions barchart-udt-core/doc/epoll-review.md
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

0 comments on commit 83a70e8

Please sign in to comment.