Changeset 19
- Timestamp:
- Nov 7, 2005 6:14:08 PM (19 years ago)
- Location:
- pjproject/main/pjlib
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/main/pjlib/build/Makefile
r14 r19 85 85 # 86 86 export TEST_SRCDIR = ../src/pjlib-test 87 export TEST_OBJS += atomic.o echo_clt.o e cho_srv.o errno.o exception.o \88 fifobuf.o \87 export TEST_OBJS += atomic.o echo_clt.o errno.o exception.o \ 88 fifobuf.o file.o \ 89 89 ioq_perf.o ioq_udp.o ioq_tcp.o \ 90 90 list.o mutex.o os.o pool.o pool_perf.o rand.o rbtree.o \ 91 91 select.o sleep.o sock.o sock_perf.o \ 92 92 string.o test.o thread.o timer.o timestamp.o \ 93 udp_echo_srv_sync.o \93 udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \ 94 94 util.o xml.o 95 95 export TEST_CFLAGS += $(_CFLAGS) … … 114 114 $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test print_bin 115 115 116 depend: 116 depend: ../include/pj/config_site.h 117 117 $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib depend 118 118 $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test depend -
pjproject/main/pjlib/build/os-linux.mak
r14 r19 18 18 export PJLIB_OBJS += ioqueue_epoll.o 19 19 20 export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o 21 20 22 # 21 23 # TEST_OBJS are operating system specific object files to be included in -
pjproject/main/pjlib/include/pj/ioqueue.h
r18 r19 109 109 * - \ref page_pjlib_ioqueue_perf_test 110 110 */ 111 112 111 113 112 … … 219 218 # define PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL (16) 220 219 #endif 220 221 /** 222 * Return the name of the ioqueue implementation. 223 * 224 * @return Implementation name. 225 */ 226 PJ_DECL(const char*) pj_ioqueue_name(void); 221 227 222 228 -
pjproject/main/pjlib/src/pj/config.c
r11 r19 3 3 #include <pj/config.h> 4 4 #include <pj/log.h> 5 #include <pj/ioqueue.h> 5 6 6 7 static const char *id = "config.c"; … … 24 25 PJ_LOG(3, (id, " PJ_HAS_EVENT_OBJ : %d", PJ_HAS_EVENT_OBJ)); 25 26 PJ_LOG(3, (id, " PJ_HAS_HIGH_RES_TIMER : %d", PJ_HAS_HIGH_RES_TIMER)); 26 PJ_LOG(3, (id, " PJ_(endianness) : %s", (PJ_IS_BIG_ENDIAN?"big-endian":"little-endian"))); 27 PJ_LOG(3, (id, " PJ_(endianness) : %s", 28 (PJ_IS_BIG_ENDIAN?"big-endian":"little-endian"))); 29 PJ_LOG(3, (id, " ioqueue type : %s", pj_ioqueue_name())); 27 30 PJ_LOG(3, (id, " PJ_IOQUEUE_MAX_HANDLES : %d", PJ_IOQUEUE_MAX_HANDLES)); 28 31 } -
pjproject/main/pjlib/src/pj/ioqueue_epoll.c
r14 r19 160 160 161 161 /* 162 * pj_ioqueue_name() 163 */ 164 PJ_DEF(const char*) pj_ioqueue_name(void) 165 { 166 #if defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0 167 return "epoll-kernel"; 168 #else 169 return "epoll"; 170 #endif 171 } 172 173 /* 162 174 * pj_ioqueue_create() 163 175 * -
pjproject/main/pjlib/src/pj/ioqueue_select.c
r16 r19 105 105 */ 106 106 #include "ioqueue_common_abs.c" 107 108 /* 109 * pj_ioqueue_name() 110 */ 111 PJ_DEF(const char*) pj_ioqueue_name(void) 112 { 113 return "select"; 114 } 107 115 108 116 /* -
pjproject/main/pjlib/src/pj/ioqueue_winnt.c
r18 r19 223 223 } 224 224 #endif 225 226 /* 227 * pj_ioqueue_name() 228 */ 229 PJ_DEF(const char*) pj_ioqueue_name(void) 230 { 231 return "iocp"; 232 } 225 233 226 234 /* -
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(); -
pjproject/main/pjlib/src/pjlib-test/test.h
r18 r19 10 10 #define GROUP_DATA_STRUCTURE 0 11 11 #define GROUP_NETWORK 0 12 #define GROUP_FILE 112 #define GROUP_FILE 0 13 13 #define GROUP_EXTRA 0 14 14 … … 37 37 #define INCLUDE_XML_TEST GROUP_EXTRA 38 38 39 #define INCLUDE_ECHO_SERVER 039 #define INCLUDE_ECHO_SERVER 1 40 40 #define INCLUDE_ECHO_CLIENT 0 41 41 42 42 43 #define ECHO_SERVER_MAX_THREADS 443 #define ECHO_SERVER_MAX_THREADS 2 44 44 #define ECHO_SERVER_START_PORT 65000 45 45 #define ECHO_SERVER_ADDRESS "compaq.home" -
pjproject/main/pjlib/src/pjlib-test/udp_echo_srv_sync.c
r11 r19 61 61 } 62 62 63 rc = app_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 63 rc = app_socket(PJ_AF_INET, PJ_SOCK_DGRAM,0, ECHO_SERVER_START_PORT, &sock); 64 64 if (rc != PJ_SUCCESS) { 65 65 app_perror("...socket error", rc); … … 122 122 count++; 123 123 124 PJ_LOG(3,("", "Synchronous UDP (%d threads): %u KB/s 124 PJ_LOG(3,("", "Synchronous UDP (%d threads): %u KB/s (avg=%u KB/s) %s", 125 125 ECHO_SERVER_MAX_THREADS, 126 126 (unsigned)(bw / 1000),
Note: See TracChangeset
for help on using the changeset viewer.