예제 #1
0
static void deal_ioevents(IOEventPoller *ioevent, const int count)
{
	int i;
	int event;
	IOEventEntry *pEntry;
	for (i=0; i<count; i++)
	{
		event = IOEVENT_GET_EVENTS(ioevent, i);
		pEntry = (IOEventEntry *)IOEVENT_GET_DATA(ioevent, i);

		pEntry->callback(pEntry->fd, event, pEntry->timer.data);
	}
}
예제 #2
0
static void deal_ioevents(IOEventPoller *ioevent)
{
	int event;
	IOEventEntry *pEntry;

	for (ioevent->iterator.index=0; ioevent->iterator.index < ioevent->iterator.
            count; ioevent->iterator.index++)
	{
		event = IOEVENT_GET_EVENTS(ioevent, ioevent->iterator.index);
		pEntry = (IOEventEntry *)IOEVENT_GET_DATA(ioevent,
                ioevent->iterator.index);
        if (pEntry != NULL) {
            pEntry->callback(pEntry->fd, event, pEntry->timer.data);
        }
        else {
            logDebug("file: "__FILE__", line: %d, "
                    "ignore iovent : %d, index: %d", __LINE__, event, ioevent->iterator.index);
        }
	}
}
예제 #3
0
static void deal_timeouts(FastTimerEntry *head)
{
	FastTimerEntry *entry;
	FastTimerEntry *current;
	IOEventEntry *pEventEntry;

	entry = head->next;
	while (entry != NULL)
	{
		current = entry;
		entry = entry->next;

		pEventEntry = (IOEventEntry *)current->data;
		if (pEventEntry != NULL)
		{
			pEventEntry->callback(pEventEntry->fd, IOEVENT_TIMEOUT,
						current->data);
		}
	}
}
예제 #4
0
static void deal_timeouts(FastTimerEntry *head)
{
	FastTimerEntry *entry;
	FastTimerEntry *current;
	IOEventEntry *pEventEntry;

	entry = head->next;
	while (entry != NULL)
	{
		current = entry;
		entry = entry->next;

        current->prev = current->next = NULL; //must set NULL because NOT in time wheel
		pEventEntry = (IOEventEntry *)current->data;
		if (pEventEntry != NULL)
		{
			pEventEntry->callback(pEventEntry->fd, IOEVENT_TIMEOUT,
						current->data);
		}
	}
}