- Timestamp:
- Nov 6, 2005 7:46:48 PM (19 years ago)
- Location:
- pjproject/main/pjlib
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/build/pjlib.dsp
r12 r17 217 217 218 218 SOURCE=..\src\pj\ioqueue_select.c 219 # PROP Exclude_From_Build 1 219 220 # End Source File 220 221 # Begin Source File 221 222 222 223 SOURCE=..\src\pj\ioqueue_winnt.c 223 # PROP Exclude_From_Build 1224 224 # End Source File 225 225 # Begin Source File -
pjproject/main/pjlib/build/pjlib_test.dsp
r11 r17 96 96 # Begin Source File 97 97 98 SOURCE="..\src\pjlib-test\echo_srv.c"99 # End Source File100 # Begin Source File101 102 98 SOURCE="..\src\pjlib-test\errno.c" 103 99 # End Source File -
pjproject/main/pjlib/src/pj/ioqueue_common_abs.c
r14 r17 288 288 /* Done. */ 289 289 } else { 290 pj_assert(!"Descriptor is signaled but key " 291 "has no pending operation!"); 292 290 /* 291 * This is normal; execution may fall here when multiple threads 292 * are signalled for the same event, but only one thread eventually 293 * able to process the event. 294 */ 293 295 pj_mutex_unlock(h->mutex); 294 296 } … … 417 419 418 420 } else { 421 /* 422 * This is normal; execution may fall here when multiple threads 423 * are signalled for the same event, but only one thread eventually 424 * able to process the event. 425 */ 419 426 pj_mutex_unlock(h->mutex); 420 427 } … … 617 624 write_op = (struct write_operation*)op_key; 618 625 write_op->op = PJ_IOQUEUE_OP_SEND; 619 write_op->buf = NULL;626 write_op->buf = (void*)data; 620 627 write_op->size = *length; 621 628 write_op->written = 0; … … 695 702 write_op = (struct write_operation*)op_key; 696 703 write_op->op = PJ_IOQUEUE_OP_SEND_TO; 697 write_op->buf = NULL;704 write_op->buf = (void*)data; 698 705 write_op->size = *length; 699 706 write_op->written = 0; -
pjproject/main/pjlib/src/pjlib-test/list.c
r6 r17 34 34 typedef struct list_node 35 35 { 36 PJ_DECL_LIST_MEMBER(struct list_node) 36 PJ_DECL_LIST_MEMBER(struct list_node); 37 37 int value; 38 38 } list_node; -
pjproject/main/pjlib/src/pjlib-test/test.c
r11 r17 133 133 #if INCLUDE_ECHO_SERVER 134 134 //echo_server(); 135 echo_srv_sync(); 135 //echo_srv_sync(); 136 udp_echo_srv_ioqueue(); 137 136 138 #elif INCLUDE_ECHO_CLIENT 137 139 if (param_echo_sock_type == 0) -
pjproject/main/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
r11 r17 15 15 int is_pending; 16 16 pj_status_t last_err; 17 pj_sockaddr_in addr; 18 int addrlen; 17 19 }; 18 20 … … 29 31 30 32 if (bytes_received < 0) { 31 PJ_LOG(3,("","...error receiving data, received=%d", 32 bytes_received)); 33 if (-bytes_received != recv_rec->last_err) { 34 recv_rec->last_err = -bytes_received; 35 app_perror("...error receiving data", -bytes_received); 36 } 33 37 } else if (bytes_received == 0) { 34 38 /* note: previous error, or write callback */ … … 39 43 pj_ssize_t sent = bytes_received; 40 44 pj_memcpy(send_rec->buffer, recv_rec->buffer, bytes_received); 41 rc = pj_ioqueue_send(key, &send_rec->op_key_, 42 send_rec->buffer, &sent, 0); 45 pj_memcpy(&send_rec->addr, &recv_rec->addr, recv_rec->addrlen); 46 send_rec->addrlen = recv_rec->addrlen; 47 rc = pj_ioqueue_sendto(key, &send_rec->op_key_, 48 send_rec->buffer, &sent, 0, 49 &send_rec->addr, send_rec->addrlen); 43 50 send_rec->is_pending = (rc==PJ_EPENDING); 44 51 45 52 if (rc!=PJ_SUCCESS && rc!=PJ_EPENDING) { 46 app_perror("...send error ", rc);53 app_perror("...send error(1)", rc); 47 54 } 48 55 } … … 51 58 if (!send_rec->is_pending) { 52 59 bytes_received = recv_rec->size; 53 rc = pj_ioqueue_recv(key, &recv_rec->op_key_, 54 recv_rec->buffer, &bytes_received, 0); 60 rc = pj_ioqueue_recvfrom(key, &recv_rec->op_key_, 61 recv_rec->buffer, &bytes_received, 0, 62 &recv_rec->addr, &recv_rec->addrlen); 55 63 recv_rec->is_pending = (rc==PJ_EPENDING); 56 64 if (rc == PJ_SUCCESS) { … … 81 89 82 90 if (bytes_sent <= 0) { 83 pj_status_t rc = pj_get_netos_error(); 84 app_perror("...send error", rc); 91 pj_status_t rc = -bytes_sent; 92 if (rc != send_rec->last_err) { 93 send_rec->last_err = rc; 94 app_perror("...send error(2)", rc); 95 } 85 96 } 86 97 … … 102 113 read_op.buffer = recv_buf; 103 114 read_op.size = sizeof(recv_buf); 115 read_op.addrlen = sizeof(read_op.addr); 116 104 117 write_op.peer = &read_op; 105 118 write_op.is_pending = 0; … … 109 122 110 123 length = sizeof(recv_buf); 111 rc = pj_ioqueue_recv(key, &read_op.op_key_, recv_buf, &length, 0); 124 rc = pj_ioqueue_recvfrom(key, &read_op.op_key_, recv_buf, &length, 0, 125 &read_op.addr, &read_op.addrlen); 112 126 if (rc == PJ_SUCCESS) { 113 127 read_op.is_pending = 1;
Note: See TracChangeset
for help on using the changeset viewer.