Hi! Benny, I am studing the ioqueue_select.c for adding PJ_IOQUEUE_HAS_SAFE_UNREG to ioqueue_epoll.c. I have a question about PJ_IOQUEUE_KEY_FREE_DELAY. Why does the ioqueue key need to delay PJ_IOQUEUE_KEY_FREE_DELAY before put in the free-list? When I set the value of max_fd to 1 in pj_ioqueue_create() and register a TCP socket to send a message, it works ok. After finished sending the message and unregister the key then register a new TCP socket(shorter than PJ_IOQUEUE_KEY_FREE_DELAY), the pj_ioqueue_register_sock() is stopped at pj_assert(!pj_list_empty(&ioqueue->free_list)). This is caused by that the only one key is in closing list. There are two way to fix this issue, one is to create more key in pj_ioqueue_create(). But how many key should be created? The other is to allocate memory for new key in pj_ioqueue_register_sock() when free list is empty and reuse it. What do you think? Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080902/18c7762d/attachment.html