Index: /pjproject/main/pjlib/build/Makefile
===================================================================
--- /pjproject/main/pjlib/build/Makefile	(revision 18)
+++ /pjproject/main/pjlib/build/Makefile	(revision 19)
@@ -85,11 +85,11 @@
 #
 export TEST_SRCDIR = ../src/pjlib-test
-export TEST_OBJS += atomic.o echo_clt.o echo_srv.o errno.o exception.o \
-		    fifobuf.o \
+export TEST_OBJS += atomic.o echo_clt.o errno.o exception.o \
+		    fifobuf.o file.o \
 		    ioq_perf.o ioq_udp.o ioq_tcp.o \
 		    list.o mutex.o os.o pool.o pool_perf.o rand.o rbtree.o \
 		    select.o sleep.o sock.o sock_perf.o \
 		    string.o test.o thread.o timer.o timestamp.o \
-		    udp_echo_srv_sync.o \
+		    udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \
 		    util.o xml.o
 export TEST_CFLAGS += $(_CFLAGS)
@@ -114,5 +114,5 @@
 	$(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test print_bin
 	
-depend:
+depend: ../include/pj/config_site.h
 	$(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib depend
 	$(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test depend
Index: /pjproject/main/pjlib/build/os-linux.mak
===================================================================
--- /pjproject/main/pjlib/build/os-linux.mak	(revision 18)
+++ /pjproject/main/pjlib/build/os-linux.mak	(revision 19)
@@ -18,4 +18,6 @@
 export PJLIB_OBJS += ioqueue_epoll.o
 
+export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o
+
 #
 # TEST_OBJS are operating system specific object files to be included in
Index: /pjproject/main/pjlib/include/pj/ioqueue.h
===================================================================
--- /pjproject/main/pjlib/include/pj/ioqueue.h	(revision 18)
+++ /pjproject/main/pjlib/include/pj/ioqueue.h	(revision 19)
@@ -109,5 +109,4 @@
  *  - \ref page_pjlib_ioqueue_perf_test
  */
-
 
 
@@ -219,4 +218,11 @@
 #   define PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL     (16)
 #endif
+
+/**
+ * Return the name of the ioqueue implementation.
+ *
+ * @return		Implementation name.
+ */
+PJ_DECL(const char*) pj_ioqueue_name(void);
 
 
Index: /pjproject/main/pjlib/src/pj/config.c
===================================================================
--- /pjproject/main/pjlib/src/pj/config.c	(revision 18)
+++ /pjproject/main/pjlib/src/pj/config.c	(revision 19)
@@ -3,4 +3,5 @@
 #include <pj/config.h>
 #include <pj/log.h>
+#include <pj/ioqueue.h>
 
 static const char *id = "config.c";
@@ -24,5 +25,7 @@
     PJ_LOG(3, (id, " PJ_HAS_EVENT_OBJ         : %d", PJ_HAS_EVENT_OBJ));
     PJ_LOG(3, (id, " PJ_HAS_HIGH_RES_TIMER    : %d", PJ_HAS_HIGH_RES_TIMER));
-    PJ_LOG(3, (id, " PJ_(endianness)          : %s", (PJ_IS_BIG_ENDIAN?"big-endian":"little-endian")));
+    PJ_LOG(3, (id, " PJ_(endianness)          : %s", 
+	       (PJ_IS_BIG_ENDIAN?"big-endian":"little-endian")));
+    PJ_LOG(3, (id, " ioqueue type             : %s", pj_ioqueue_name()));
     PJ_LOG(3, (id, " PJ_IOQUEUE_MAX_HANDLES   : %d", PJ_IOQUEUE_MAX_HANDLES));
 }
Index: /pjproject/main/pjlib/src/pj/file_access_unistd.c
===================================================================
--- /pjproject/main/pjlib/src/pj/file_access_unistd.c	(revision 19)
+++ /pjproject/main/pjlib/src/pj/file_access_unistd.c	(revision 19)
@@ -0,0 +1,96 @@
+/* $Id$ */
+#include <pj/file_access.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdio.h>	/* rename() */
+#include <errno.h>
+
+/*
+ * pj_file_exists()
+ */
+PJ_DEF(pj_bool_t) pj_file_exists(const char *filename)
+{
+    struct stat buf;
+
+    PJ_ASSERT_RETURN(filename, 0);
+
+    if (stat(filename, &buf) != 0)
+	return 0;
+
+    return PJ_TRUE;
+}
+
+
+/*
+ * pj_file_size()
+ */
+PJ_DEF(pj_off_t) pj_file_size(const char *filename)
+{
+    struct stat buf;
+
+    PJ_ASSERT_RETURN(filename, -1);
+
+    if (stat(filename, &buf) != 0)
+	return -1;
+
+    return buf.st_size;
+}
+
+
+/*
+ * pj_file_delete()
+ */
+PJ_DEF(pj_status_t) pj_file_delete(const char *filename)
+{
+    PJ_ASSERT_RETURN(filename, PJ_EINVAL);
+
+    if (unlink(filename)!=0) {
+	return PJ_RETURN_OS_ERROR(errno);
+    }
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * pj_file_move()
+ */
+PJ_DEF(pj_status_t) pj_file_move( const char *oldname, const char *newname)
+{
+    PJ_ASSERT_RETURN(oldname && newname, PJ_EINVAL);
+
+    if (rename(oldname, newname) != 0) {
+	return PJ_RETURN_OS_ERROR(errno);
+    }
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * pj_file_getstat()
+ */
+PJ_DEF(pj_status_t) pj_file_getstat(const char *filename, 
+				    pj_file_stat *statbuf)
+{
+    struct stat buf;
+
+    PJ_ASSERT_RETURN(filename && statbuf, PJ_EINVAL);
+
+    if (stat(filename, &buf) != 0) {
+	return PJ_RETURN_OS_ERROR(errno);
+    }
+
+    statbuf->size = buf.st_size;
+    statbuf->ctime.sec = buf.st_ctime;
+    statbuf->ctime.msec = 0;
+    statbuf->mtime.sec = buf.st_mtime;
+    statbuf->mtime.msec = 0;
+    statbuf->atime.sec = buf.st_atime;
+    statbuf->atime.msec = 0;
+
+    return PJ_SUCCESS;
+}
+
Index: /pjproject/main/pjlib/src/pj/ioqueue_epoll.c
===================================================================
--- /pjproject/main/pjlib/src/pj/ioqueue_epoll.c	(revision 18)
+++ /pjproject/main/pjlib/src/pj/ioqueue_epoll.c	(revision 19)
@@ -160,4 +160,16 @@
 
 /*
+ * pj_ioqueue_name()
+ */
+PJ_DEF(const char*) pj_ioqueue_name(void)
+{
+#if defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
+	return "epoll-kernel";
+#else
+	return "epoll";
+#endif
+}
+
+/*
  * pj_ioqueue_create()
  *
Index: /pjproject/main/pjlib/src/pj/ioqueue_select.c
===================================================================
--- /pjproject/main/pjlib/src/pj/ioqueue_select.c	(revision 18)
+++ /pjproject/main/pjlib/src/pj/ioqueue_select.c	(revision 19)
@@ -105,4 +105,12 @@
  */
 #include "ioqueue_common_abs.c"
+
+/*
+ * pj_ioqueue_name()
+ */
+PJ_DEF(const char*) pj_ioqueue_name(void)
+{
+    return "select";
+}
 
 /*
Index: /pjproject/main/pjlib/src/pj/ioqueue_winnt.c
===================================================================
--- /pjproject/main/pjlib/src/pj/ioqueue_winnt.c	(revision 18)
+++ /pjproject/main/pjlib/src/pj/ioqueue_winnt.c	(revision 19)
@@ -223,4 +223,12 @@
 }
 #endif
+
+/*
+ * pj_ioqueue_name()
+ */
+PJ_DEF(const char*) pj_ioqueue_name(void)
+{
+    return "iocp";
+}
 
 /*
Index: /pjproject/main/pjlib/src/pjlib-test/echo_clt.c
===================================================================
--- /pjproject/main/pjlib/src/pjlib-test/echo_clt.c	(revision 18)
+++ /pjproject/main/pjlib/src/pjlib-test/echo_clt.c	(revision 19)
@@ -42,4 +42,7 @@
     pj_str_t s;
     pj_status_t rc;
+    pj_uint32_t buffer_id;
+    pj_uint32_t buffer_counter;
+    pj_uint32_t timeout_counter=0, invalid_counter=0;
     struct client *client = arg;
     pj_status_t last_recv_err = PJ_SUCCESS, last_send_err = PJ_SUCCESS;
@@ -78,12 +81,22 @@
     //PJ_LOG(3,("", "...thread %p running", pj_thread_this()));
 
+    buffer_id = (pj_uint32_t) pj_thread_this();
+    buffer_counter = 0;
+
+    *(pj_uint32_t*)send_buf = buffer_id;
+
     for (;;) {
         int rc;
         pj_ssize_t bytes;
+	pj_uint32_t *p_buffer_id, *p_buffer_counter;
 
 	++counter;
+
+	while (wait_socket(sock,0) > 0)
+	    ;
 
         /* Send a packet. */
         bytes = BUF_SIZE;
+	*(pj_uint32_t*)(send_buf+4) = ++buffer_counter;
         rc = pj_sock_send(sock, send_buf, &bytes, 0);
         if (rc != PJ_SUCCESS || bytes != BUF_SIZE) {
@@ -101,4 +114,5 @@
             PJ_LOG(3,("", "...timeout"));
 	    bytes = 0;
+	    timeout_counter++;
 	} else if (rc < 0) {
 	    rc = pj_get_netos_error();
Index: /pjproject/main/pjlib/src/pjlib-test/test.c
===================================================================
--- /pjproject/main/pjlib/src/pjlib-test/test.c	(revision 18)
+++ /pjproject/main/pjlib/src/pjlib-test/test.c	(revision 19)
Index: /pjproject/main/pjlib/src/pjlib-test/test.h
===================================================================
--- /pjproject/main/pjlib/src/pjlib-test/test.h	(revision 18)
+++ /pjproject/main/pjlib/src/pjlib-test/test.h	(revision 19)
@@ -10,5 +10,5 @@
 #define GROUP_DATA_STRUCTURE        0
 #define GROUP_NETWORK               0
-#define GROUP_FILE                  1
+#define GROUP_FILE                  0
 #define GROUP_EXTRA                 0
 
@@ -37,9 +37,9 @@
 #define INCLUDE_XML_TEST	    GROUP_EXTRA
 
-#define INCLUDE_ECHO_SERVER         0
+#define INCLUDE_ECHO_SERVER         1
 #define INCLUDE_ECHO_CLIENT         0
 
 
-#define ECHO_SERVER_MAX_THREADS     4
+#define ECHO_SERVER_MAX_THREADS     2
 #define ECHO_SERVER_START_PORT      65000
 #define ECHO_SERVER_ADDRESS         "compaq.home"
Index: /pjproject/main/pjlib/src/pjlib-test/udp_echo_srv_sync.c
===================================================================
--- /pjproject/main/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 18)
+++ /pjproject/main/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 19)
@@ -61,5 +61,5 @@
     }
 
-    rc = app_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, ECHO_SERVER_START_PORT, &sock);
+    rc = app_socket(PJ_AF_INET, PJ_SOCK_DGRAM,0, ECHO_SERVER_START_PORT, &sock);
     if (rc != PJ_SUCCESS) {
         app_perror("...socket error", rc);
@@ -122,5 +122,5 @@
         count++;
 
-        PJ_LOG(3,("", "Synchronous UDP (%d threads): %u KB/s  (avg=%u KB/s) %s", 
+        PJ_LOG(3,("", "Synchronous UDP (%d threads): %u KB/s (avg=%u KB/s) %s", 
                   ECHO_SERVER_MAX_THREADS, 
                   (unsigned)(bw / 1000),
