Changeset 20


Ignore:
Timestamp:
Nov 7, 2005 6:25:16 PM (18 years ago)
Author:
bennylp
Message:

Added more checking in UDP client

Location:
pjproject/main/pjlib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjlib/build/os-win32.mak

    r18 r20  
    1414                        pool_policy_malloc.o sock_bsd.o sock_select.o 
    1515 
    16 export PJLIB_OBJS +=    ioqueue_win32.o 
     16export PJLIB_OBJS +=    ioqueue_winnt.o 
    1717#export PJLIB_OBJS +=   ioqueue_select.o 
    1818 
    19 export PJLIB_OBJS +=    file_io_win32.o 
     19export PJLIB_OBJS +=    file_io_win32.o file_access_win32.o 
    2020#export PJLIB_OBJS +=   file_io_ansi.o 
    2121 
  • pjproject/main/pjlib/src/pjlib-test/echo_clt.c

    r19 r20  
    1616 
    1717static pj_atomic_t *totalBytes; 
     18static pj_atomic_t *timeout_counter; 
     19static pj_atomic_t *invalid_counter; 
    1820 
    1921#define MSEC_PRINT_DURATION 1000 
     
    4446    pj_uint32_t buffer_id; 
    4547    pj_uint32_t buffer_counter; 
    46     pj_uint32_t timeout_counter=0, invalid_counter=0; 
    4748    struct client *client = arg; 
    4849    pj_status_t last_recv_err = PJ_SUCCESS, last_send_err = PJ_SUCCESS; 
     
    8990        int rc; 
    9091        pj_ssize_t bytes; 
    91         pj_uint32_t *p_buffer_id, *p_buffer_counter; 
    9292 
    9393        ++counter; 
    9494 
    95         while (wait_socket(sock,0) > 0) 
    96             ; 
     95        //while (wait_socket(sock,0) > 0) 
     96        //    ; 
    9797 
    9898        /* Send a packet. */ 
     
    114114            PJ_LOG(3,("", "...timeout")); 
    115115            bytes = 0; 
    116             timeout_counter++; 
     116            pj_atomic_inc(timeout_counter); 
    117117        } else if (rc < 0) { 
    118118            rc = pj_get_netos_error(); 
     
    149149                          "recv_buf=%s\n",  
    150150                          counter, send_buf, recv_buf)); 
    151             //break; 
     151            pj_atomic_inc(invalid_counter); 
    152152        } 
    153153 
     
    181181        return -30; 
    182182    } 
     183    rc = pj_atomic_create(pool, 0, &invalid_counter); 
     184    rc = pj_atomic_create(pool, 0, &timeout_counter); 
    183185 
    184186    PJ_LOG(3,("", "Echo client started")); 
     
    207209        pj_time_val elapsed; 
    208210        unsigned bw32; 
     211        pj_uint32_t timeout, invalid; 
    209212 
    210213        pj_thread_sleep(1000); 
     
    226229        last_received = received; 
    227230 
    228         PJ_LOG(3,("", "...%d threads, total bandwidth: %d KB/s",  
    229                   ECHO_CLIENT_MAX_THREADS, bw32/1000)); 
     231        timeout = pj_atomic_get(timeout_counter); 
     232        invalid = pj_atomic_get(invalid_counter); 
     233 
     234        PJ_LOG(3,("",  
     235                  "...%d threads, total bandwidth: %d KB/s, " 
     236                  "timeout=%d, invalid=%d",  
     237                  ECHO_CLIENT_MAX_THREADS, bw32/1000, 
     238                  timeout, invalid)); 
    230239    } 
    231240 
  • pjproject/main/pjlib/src/pjlib-test/test.h

    r19 r20  
    3737#define INCLUDE_XML_TEST            GROUP_EXTRA 
    3838 
    39 #define INCLUDE_ECHO_SERVER         1 
    40 #define INCLUDE_ECHO_CLIENT         0 
     39#define INCLUDE_ECHO_SERVER         0 
     40#define INCLUDE_ECHO_CLIENT         1 
    4141 
    4242 
Note: See TracChangeset for help on using the changeset viewer.