Ignore:
Timestamp:
Nov 6, 2005 4:50:38 PM (19 years ago)
Author:
bennylp
Message:

Tested new ioqueue framework on Linux with select and epoll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjlib/src/pj/ioqueue_common_abs.c

    r13 r14  
    11/* $Id$ */ 
    22 
    3 #include <pj/ioqueue.h> 
    4 #include <pj/errno.h> 
    5 #include <pj/list.h> 
    6 #include <pj/sock.h> 
    7 #include <pj/lock.h> 
    8 #include <pj/assert.h> 
    9 #include <pj/string.h> 
    10  
     3/* 
     4 * ioqueue_common_abs.c 
     5 * 
     6 * This contains common functionalities to emulate proactor pattern with 
     7 * various event dispatching mechanisms (e.g. select, epoll). 
     8 * 
     9 * This file will be included by the appropriate ioqueue implementation. 
     10 * This file is NOT supposed to be compiled as stand-alone source. 
     11 */ 
    1112 
    1213static void ioqueue_init( pj_ioqueue_t *ioqueue ) 
     
    326327 
    327328        /* Call callback. */ 
    328         if (h->cb.on_accept_complete) 
     329        if (h->cb.on_accept_complete) { 
    329330            (*h->cb.on_accept_complete)(h,  
    330331                                        (pj_ioqueue_op_key_t*)accept_op, 
    331332                                        *accept_op->accept_fd, rc); 
     333        } 
    332334 
    333335    } 
     
    337339        struct read_operation *read_op; 
    338340        pj_ssize_t bytes_read; 
    339  
    340         pj_assert(!pj_list_empty(&h->read_list)); 
    341341 
    342342        /* Get one pending read operation from the list. */ 
     
    378378                //              &bytes_read, NULL); 
    379379#           elif (defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H != 0) 
    380                 bytes_read = read(h->fd, h->rd_buf, bytes_read); 
     380                bytes_read = read(h->fd, read_op->buf, bytes_read); 
    381381                rc = (bytes_read >= 0) ? PJ_SUCCESS : pj_get_os_error(); 
    382382#           elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 
    383                 bytes_read = sys_read(h->fd, h->rd_buf, bytes_read); 
     383                bytes_read = sys_read(h->fd, read_op->buf, bytes_read); 
    384384                rc = (bytes_read >= 0) ? PJ_SUCCESS : -bytes_read; 
    385385#           else 
Note: See TracChangeset for help on using the changeset viewer.