|
|
|
@ -66,7 +66,7 @@ commManagerEpollDtor(void * _this) |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) |
|
|
|
{ |
|
|
|
TR_CommManagerEpoll this = _this; |
|
|
|
@ -79,10 +79,12 @@ TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) |
|
|
|
event.events = this->events[handle]; |
|
|
|
|
|
|
|
epoll_ctl(this->handle, EPOLL_CTL_ADD, handle, &event); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) |
|
|
|
{ |
|
|
|
TR_CommManagerEpoll this = _this; |
|
|
|
@ -131,11 +133,13 @@ TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) |
|
|
|
NULL)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
inline |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) |
|
|
|
{ |
|
|
|
TR_CommManagerEpoll this = _this; |
|
|
|
@ -148,11 +152,13 @@ TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) |
|
|
|
_event.events = this->events[handle]; |
|
|
|
|
|
|
|
epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
inline |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) |
|
|
|
{ |
|
|
|
TR_CommManagerEpoll this = _this; |
|
|
|
@ -165,48 +171,60 @@ TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) |
|
|
|
_event.events = this->events[handle]; |
|
|
|
|
|
|
|
epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollEnableWrite(void * _this, TR_Event event) |
|
|
|
{ |
|
|
|
if (! TR_socketFinWr(((TR_CommEndPoint)event->subject)->transport)) { |
|
|
|
TR_commManagerEpollEnable(_this, EPOLLOUT, event); |
|
|
|
} |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollEnableRead(void * _this, TR_Event event) |
|
|
|
{ |
|
|
|
if (! TR_socketFinRd(((TR_CommEndPoint)event->subject)->transport)) { |
|
|
|
TR_commManagerEpollEnable(_this, EPOLLIN, event); |
|
|
|
} |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollDisableWrite(void * _this, TR_Event event) |
|
|
|
{ |
|
|
|
TR_commManagerEpollDisable(_this, EPOLLOUT, event); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollDisableRead(void * _this, TR_Event event) |
|
|
|
{ |
|
|
|
TR_commManagerEpollDisable(_this, EPOLLIN, event); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
TR_EventDone |
|
|
|
TR_commManagerEpollClose(void * _this, TR_Event event) |
|
|
|
{ |
|
|
|
TR_CommManagerEpoll this = _this; |
|
|
|
TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
|
|
|
|
|
|
|
epoll_ctl(this->handle, EPOLL_CTL_DEL, endpoint->transport->handle, NULL); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
|