Changeset 19 for pjproject/main/pjlib/src/pjlib-test/echo_clt.c
- Timestamp:
- Nov 7, 2005 6:14:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/src/pjlib-test/echo_clt.c
r6 r19 42 42 pj_str_t s; 43 43 pj_status_t rc; 44 pj_uint32_t buffer_id; 45 pj_uint32_t buffer_counter; 46 pj_uint32_t timeout_counter=0, invalid_counter=0; 44 47 struct client *client = arg; 45 48 pj_status_t last_recv_err = PJ_SUCCESS, last_send_err = PJ_SUCCESS; … … 78 81 //PJ_LOG(3,("", "...thread %p running", pj_thread_this())); 79 82 83 buffer_id = (pj_uint32_t) pj_thread_this(); 84 buffer_counter = 0; 85 86 *(pj_uint32_t*)send_buf = buffer_id; 87 80 88 for (;;) { 81 89 int rc; 82 90 pj_ssize_t bytes; 91 pj_uint32_t *p_buffer_id, *p_buffer_counter; 83 92 84 93 ++counter; 94 95 while (wait_socket(sock,0) > 0) 96 ; 85 97 86 98 /* Send a packet. */ 87 99 bytes = BUF_SIZE; 100 *(pj_uint32_t*)(send_buf+4) = ++buffer_counter; 88 101 rc = pj_sock_send(sock, send_buf, &bytes, 0); 89 102 if (rc != PJ_SUCCESS || bytes != BUF_SIZE) { … … 101 114 PJ_LOG(3,("", "...timeout")); 102 115 bytes = 0; 116 timeout_counter++; 103 117 } else if (rc < 0) { 104 118 rc = pj_get_netos_error();
Note: See TracChangeset
for help on using the changeset viewer.