This file provides implementation to test the functionality of the I/O queue when UDP socket is used.
#include "test.h"
#if INCLUDE_UDP_IOQUEUE_TEST
#include <pjlib.h>
#include <pj/compat/socket.h>
#define THIS_FILE "test_udp"
#define PORT 51233
#define LOOP 2
#define BUF_MIN_SIZE 32
#define BUF_MAX_SIZE 2048
#define SOCK_INACTIVE_MIN (1)
#define SOCK_INACTIVE_MAX (PJ_IOQUEUE_MAX_HANDLES - 2)
#define POOL_SIZE (2*BUF_MAX_SIZE + SOCK_INACTIVE_MAX*128 + 2048)
#undef TRACE_
#define TRACE_(msg) PJ_LOG(3,(THIS_FILE,"....." msg))
#if 0
# define TRACE__(args) PJ_LOG(3,args)
#else
# define TRACE__(args)
#endif
callback_write_size,
callback_accept_status,
callback_connect_status;
*callback_write_key,
*callback_accept_key,
*callback_connect_key;
*callback_write_op,
*callback_accept_op;
{
callback_read_key = key;
callback_read_size = bytes_read;
TRACE__((THIS_FILE, " callback_read_key = %p, bytes=%d",
key, bytes_read));
}
{
callback_write_key = key;
callback_write_size = bytes_written;
}
{
callback_accept_key = key;
callback_accept_status = status;
}
{
callback_connect_key = key;
callback_connect_status = status;
}
{
&on_ioqueue_read,
&on_ioqueue_write,
&on_ioqueue_accept,
&on_ioqueue_connect,
};
#if defined(PJ_WIN32) || defined(PJ_WIN64)
# define S_ADDR S_un.S_addr
#else
# define S_ADDR s_addr
#endif
{
int addrlen;
char *send_buf, *recv_buf;
int bufsize = BUF_MIN_SIZE;
int status = -1;
TRACE_("creating sockets...");
else
app_perror("...ERROR in pj_sock_socket()", rc);
status=-1; goto on_error;
}
TRACE_("bind socket...");
status=-10; goto on_error;
}
TRACE_("create ioqueue...");
status=-20; goto on_error;
}
TRACE_("registering first sockets...");
&test_cb, &skey);
app_perror("...error(10): ioqueue_register error", rc);
status=-25; goto on_error;
}
TRACE_("registering second sockets...");
&test_cb, &ckey);
app_perror("...error(11): ioqueue_register error", rc);
status=-26; goto on_error;
}
TRACE_("start recvfrom...");
addrlen = sizeof(addr);
bytes = bufsize;
&addr, &addrlen);
app_perror("...error: pj_ioqueue_recvfrom", rc);
status=-28; goto on_error;
recv_pending = 1;
"......ok: recvfrom returned pending"));
} else {
"......error: recvfrom returned immediate ok!"));
status=-29; goto on_error;
}
TRACE_("set destination address...");
app_perror("...error: unable to resolve 127.0.0.1", rc);
status=-290; goto on_error;
}
TRACE_("start sendto...");
bytes = bufsize;
sizeof(dst_addr));
app_perror("...error: pj_ioqueue_sendto", rc);
status=-30; goto on_error;
send_pending = 1;
"......ok: sendto returned pending"));
} else {
send_pending = 0;
"......ok: sendto returned immediate success"));
}
callback_read_size = callback_write_size = 0;
callback_accept_status = callback_connect_status = -2;
callback_read_key = callback_write_key =
callback_accept_key = callback_connect_key = NULL;
callback_read_op = callback_write_op = NULL;
while (send_pending || recv_pending) {
int ret;
TRACE_("poll...");
#ifdef PJ_SYMBIAN
#else
#endif
if (ret == 0) {
PJ_LOG(1,(THIS_FILE,
"...ERROR: timed out..."));
status=-45; goto on_error;
} else if (ret < 0) {
app_perror("...ERROR in ioqueue_poll()", -ret);
status=-50; goto on_error;
}
if (callback_read_key != NULL) {
if (callback_read_size != bufsize) {
status=-61; goto on_error;
}
if (callback_read_key != skey) {
status=-65; goto on_error;
}
if (callback_read_op != &read_op) {
status=-66; goto on_error;
}
if (
pj_memcmp(send_buf, recv_buf, bufsize) != 0) {
status=-67; goto on_error;
}
status=-68; goto on_error;
}
status=-69; goto on_error;
}
recv_pending = 0;
}
if (callback_write_key != NULL) {
if (callback_write_size != bufsize) {
status=-73; goto on_error;
}
if (callback_write_key != ckey) {
status=-75; goto on_error;
}
if (callback_write_op != &write_op) {
status=-76; goto on_error;
}
send_pending = 0;
}
}
status = 0;
on_error:
if (skey)
else if (ssock != -1)
if (ckey)
else if (csock != -1)
if (ioque != NULL)
return status;
}
{
(*p_packet_cnt)++;
}
{
enum { RPORT = 50000, SPORT = 50001 };
int i, addrlen;
unsigned packet_cnt;
char sendbuf[10], recvbuf[10];
void *user_data2 = (void*)(long)2;
if (!pool) {
app_perror(
"Unable to create pool",
PJ_ENOMEM);
return -100;
}
app_perror("Error creating ioqueue", status);
return -110;
}
app_perror("Error initializing socket", status);
return -120;
}
app_perror("Error initializing socket", status);
return -130;
}
packet_cnt = 0;
&cb, &key);
app_perror("Error registering to ioqueue", status);
return -140;
}
bytes = sizeof(recvbuf);
app_perror("Expecting PJ_EPENDING, but got this", status);
return -150;
}
addrlen = sizeof(addr);
app_perror("getsockname error", status);
return -160;
}
pj_ansi_strcpy(sendbuf, "Hello0123");
bytes = sizeof(sendbuf);
&addr, sizeof(addr));
app_perror("sendto error", status);
return -170;
}
#ifdef PJ_SYMBIAN
#else
#endif
if (packet_cnt != 1) {
return -180;
}
bytes = sizeof(recvbuf);
app_perror("Expecting PJ_EPENDING, but got this", status);
return -190;
}
packet_cnt = 0;
bytes = sizeof(sendbuf);
&addr, sizeof(addr));
app_perror("sendto error", status);
return -200;
}
app_perror("pj_ioqueue_unregister error", status);
return -201;
}
for (i=0; i<10; ++i) {
#ifdef PJ_SYMBIAN
#else
timeout.
sec = 0; timeout.
msec = 100;
#endif
}
if (packet_cnt > 0) {
PJ_LOG(3,(THIS_FILE,
"....errror: not expecting to receive packet "
"after socket has been closed"));
return -210;
}
for (i=0; i<2; ++i) {
}
app_perror("Error initializing socket (2)", status);
return -330;
}
&cb, &key2);
app_perror("Error registering to ioqueue (2)", status);
return -340;
}
PJ_LOG(3,(THIS_FILE,
"....info: unregistering dead key was successful"));
}
return 0;
}
{
int count, i;
PJ_LOG(3,(THIS_FILE,
"...testing with so many handles"));
if (!pool)
app_perror("...error in pj_ioqueue_create", rc);
return -10;
}
for (count=0; count<MAX; ++count) {
PJ_LOG(3,(THIS_FILE,
"....unable to create %d-th socket, rc=%d",
count, rc));
break;
}
key[count] = NULL;
NULL, &test_cb, &key[count]);
PJ_LOG(3,(THIS_FILE,
"....unable to register %d-th socket, rc=%d",
count, rc));
return -30;
}
}
for (i=count-1; i>=0; --i) {
app_perror("...error in pj_ioqueue_unregister", rc);
}
}
app_perror("...error in pj_ioqueue_destroy", rc);
}
PJ_LOG(3,(THIS_FILE,
"....many_handles_test() ok"));
return 0;
}
#if PJ_HAS_THREADS
typedef struct parallel_recv_data
{
unsigned buffer;
} parallel_recv_data;
{
parallel_recv_data *ud = (parallel_recv_data*)
op_key->user_data;
if (bytes_read < 0) {
TRACE__((THIS_FILE, "......recv() fail with status=%d, retrying",
status));
ud->len = bytes_read = sizeof(ud->buffer);
return;
}
PJ_PERROR(3,(THIS_FILE, status,
"......status=%d", status));
return;
}
}
assert (bytes_read==sizeof(unsigned));
if (ud->buffer != *p_packet_cnt) {
PJ_LOG(1,(THIS_FILE,
"......error: invalid packet sequence "
"(expecting %d, got %d)",
*p_packet_cnt, ud->buffer));
} else {
TRACE__((THIS_FILE, "......recv() sequence %d", ud->buffer));
}
(*p_packet_cnt)++;
}
typedef struct parallel_thread_data
{
unsigned id, timeout, wakeup_cnt, event_cnt, err_cnt;
} parallel_thread_data;
static int parallel_worker_thread(void *p)
{
parallel_thread_data *arg = (parallel_thread_data*)p;
t_end.
sec += arg->timeout;
while (!arg->quit_flag) {
int rc;
timeout.
sec = arg->timeout;
if (rc >= 1) {
assert(rc==1);
TRACE__((THIS_FILE, "......thread %d got event (total=%d)",
arg->id, arg->wakeup_cnt));
++arg->wakeup_cnt;
arg->event_cnt += rc;
} else if (rc == 0) {
if (!arg->quit_flag) {
TRACE__((THIS_FILE, "......thread %d wakeup, no event (total=%d)",
arg->id, arg->wakeup_cnt));
++arg->wakeup_cnt;
}
} else if (rc < 0) {
TRACE__((THIS_FILE, "......thread %d got error", arg->id));
++arg->wakeup_cnt;
++arg->err_cnt;
}
}
return 0;
}
{
enum {
ASYNC_CNT = 16,
PKT_SIZE = 16,
SEND_DELAY_MSECS = 250,
TIMEOUT_SECS = (SEND_DELAY_MSECS*ASYNC_CNT/1000)+2,
};
typedef int packet_t;
parallel_thread_data thread_datas[ASYNC_CNT], threads_total;
parallel_recv_data recv_datas[ASYNC_CNT];
unsigned i, async_send = 0, recv_packet_count = 0;
int retcode;
if (!pool) {
app_perror(
"Unable to create pool",
PJ_ENOMEM);
return -100;
}
&ssock, &csock));
&cb, &skey));
pj_bzero(recv_datas,
sizeof(recv_datas));
for (i=0; i<ASYNC_CNT; ++i) {
recv_datas[i].len = sizeof(packet_t);
&recv_datas[i].len, 0));
}
pj_bzero(thread_datas,
sizeof(thread_datas));
for (i=0; i<ASYNC_CNT; ++i) {
parallel_thread_data *arg = &thread_datas[i];
arg->ioqueue = ioqueue;
arg->id = i;
arg->timeout = TIMEOUT_SECS;
parallel_worker_thread, arg,
0, 0,&threads[i]));
}
for (i=0; i<ASYNC_CNT; ++i) {
packet_t send_buf = i;
TRACE__((THIS_FILE, "....sending"));
++async_send;
TRACE__((THIS_FILE, "......(was async sent)"));
PJ_PERROR(1,(THIS_FILE, status,
"......send error"));
retcode = -160;
goto on_return;
}
}
for (i=0; i<ASYNC_CNT; ++i) {
parallel_thread_data *arg = &thread_datas[i];
arg->quit_flag = 1;
}
for (i=0; i<ASYNC_CNT; ++i) {
}
PJ_LOG(3,(THIS_FILE,
"....Threads statistics:"));
PJ_LOG(3,(THIS_FILE,
" ============================="));
PJ_LOG(3,(THIS_FILE,
" Thread Wakeups Events Errors"));
PJ_LOG(3,(THIS_FILE,
" ============================="));
pj_bzero(&threads_total,
sizeof(threads_total));
for (i=0; i<ASYNC_CNT; ++i) {
parallel_thread_data *arg = &thread_datas[i];
threads_total.wakeup_cnt += arg->wakeup_cnt;
threads_total.event_cnt += arg->event_cnt;
threads_total.err_cnt += arg->err_cnt;
PJ_LOG(3,(THIS_FILE,
" %6d %6d %6d %6d",
arg->id, arg->wakeup_cnt, arg->event_cnt, arg->err_cnt));
}
retcode = 0;
if (recv_packet_count != ASYNC_CNT) {
PJ_LOG(1,(THIS_FILE,
"....error: rx packet count is %d (expecting %d)",
recv_packet_count, ASYNC_CNT));
retcode = -500;
}
if (threads_total.wakeup_cnt > ASYNC_CNT+async_send) {
PJ_LOG(3,(THIS_FILE,
"....info: total wakeup count is %d "
"(the perfect count is %d). This shows that "
"threads are woken up without getting any events",
threads_total.wakeup_cnt, ASYNC_CNT+async_send));
}
if (threads_total.err_cnt > 0) {
PJ_LOG(3,(THIS_FILE,
"....info: total error count is %d "
"(it should be 0)",
threads_total.err_cnt));
}
if (retcode==0)
PJ_LOG(3,(THIS_FILE,
"....success"));
on_return:
if (skey)
if (ioqueue)
return retcode;
}
#endif
int inactive_sock_count)
{
char *send_buf, *recv_buf;
int rc=0, i;
TRACE__((THIS_FILE, " bench test %d", inactive_sock_count));
} else
app_perror("...error: pj_sock_socket()", rc);
goto on_error;
}
goto on_error;
app_perror("...error: pj_ioqueue_create()", rc);
goto on_error;
}
for (i=0; i<inactive_sock_count; ++i) {
app_perror("...error: pj_sock_socket()", rc);
goto on_error;
}
if ((rc=
pj_sock_bind(inactive_sock[i], &addr,
sizeof(addr))) != 0) {
app_perror("...error: pj_sock_bind()", rc);
goto on_error;
}
NULL, &test_cb, &keys[i]);
app_perror("...error(1): pj_ioqueue_register_sock()", rc);
PJ_LOG(3,(THIS_FILE,
"....i=%d", i));
goto on_error;
}
bytes = bufsize;
sizeof(inactive_read_op[i]));
app_perror("...error: pj_ioqueue_read()", rc);
goto on_error;
}
}
&test_cb, &skey);
app_perror("...error(2): pj_ioqueue_register_sock()", rc);
goto on_error;
}
&test_cb, &ckey);
app_perror("...error(3): pj_ioqueue_register_sock()", rc);
goto on_error;
}
t_elapsed.u64 = 0;
for (i=0; i<LOOP; ++i) {
bytes = bufsize;
app_perror("...error: pj_ioqueue_read()", rc);
break;
}
bytes = bufsize;
&addr, sizeof(addr));
app_perror("...error: pj_ioqueue_write()", rc);
break;
}
if (bytes < 0) {
app_perror(
"...error: pj_ioqueue_sendto()",(
pj_status_t)-bytes);
break;
}
}
callback_read_key = NULL;
callback_read_size = 0;
TRACE__((THIS_FILE, " waiting for key = %p", skey));
do {
#ifdef PJ_SYMBIAN
#else
#endif
TRACE__((THIS_FILE, " poll rc=%d", rc));
} while (rc >= 0 && callback_read_key != skey);
t_elapsed.u64 += (t2.u64 - t1.u64);
if (rc < 0) {
app_perror(" error: pj_ioqueue_poll", -rc);
break;
}
if (callback_read_size != bufsize ||
{
rc = -10;
PJ_LOG(3,(THIS_FILE,
" error: size/buffer mismatch"));
break;
}
do {
#ifdef PJ_SYMBIAN
#else
#endif
} while (rc>0);
rc = 0;
}
if (rc == 0) {
PJ_LOG(3, (THIS_FILE,
"...%10d %15d % 9d",
bufsize, inactive_sock_count, usec_delay));
} else {
PJ_LOG(2, (THIS_FILE,
"...ERROR rc=%d (buf:%d, fds:%d)",
rc, bufsize, inactive_sock_count+2));
}
for (i=inactive_sock_count-1; i>=0; --i) {
}
return rc;
on_error:
PJ_LOG(1,(THIS_FILE,
"...ERROR: %s",
if (ssock)
if (csock)
for (i=0; i<inactive_sock_count && inactive_sock &&
{
}
if (ioque != NULL)
return -1;
}
{
int status;
int bufsize, sock_count;
char title[64];
pj_ansi_snprintf(title, sizeof(title), "%s (concur:%d, epoll_flags:0x%x)",
PJ_LOG(3, (THIS_FILE,
"...compliance test (%s)", title));
if ((status=compliance_test(cfg)) != 0) {
return status;
}
PJ_LOG(3, (THIS_FILE,
"....compliance test ok"));
PJ_LOG(3, (THIS_FILE,
"...unregister test (%s)", title));
if ((status=unregister_test(cfg)) != 0) {
return status;
}
PJ_LOG(3, (THIS_FILE,
"....unregister test ok"));
if ((status=many_handles_test(cfg)) != 0) {
return status;
}
PJ_LOG(4, (THIS_FILE,
"...benchmarking different buffer size:"));
PJ_LOG(4, (THIS_FILE,
"... note: buf=bytes sent, fds=# of fds, "
"elapsed=in timer ticks"));
PJ_LOG(3, (THIS_FILE,
"...Benchmarking poll times for %s:", title));
PJ_LOG(3, (THIS_FILE,
"...====================================="));
PJ_LOG(3, (THIS_FILE,
"...Buf.size #inactive-socks Time/poll"));
PJ_LOG(3, (THIS_FILE,
"... (bytes) (nanosec)"));
PJ_LOG(3, (THIS_FILE,
"...====================================="));
for (bufsize=BUF_MIN_SIZE; bufsize <= BUF_MAX_SIZE; bufsize *= 2) {
if ((status=bench_test(cfg, bufsize, SOCK_INACTIVE_MIN)) != 0)
return status;
}
bufsize = 512;
for (sock_count=SOCK_INACTIVE_MIN+2;
sock_count<=SOCK_INACTIVE_MAX+2;
sock_count *= 2)
{
if ((status=bench_test(cfg, bufsize, sock_count-2)) != 0)
return status;
}
return 0;
}
int udp_ioqueue_test()
{
#if PJ_HAS_LINUX_EPOLL
0,
#else
#endif
};
int i, rc, err = 0;
PJ_LOG(3, (THIS_FILE,
"..%s UDP compliance test, epoll_flags=0x%x",
rc = udp_ioqueue_test_imp(&cfg);
if (rc != 0 && err==0)
err = rc;
}
PJ_LOG(3, (THIS_FILE,
"..%s UDP compliance test, concurrency=%d",
rc = udp_ioqueue_test_imp(&cfg);
if (rc != 0 && err==0)
err = rc;
}
#if PJ_HAS_THREADS
PJ_LOG(3, (THIS_FILE,
"..%s UDP parallel compliance test, epoll_flags=0x%x",
rc = parallel_recv_test(&cfg);
if (rc != 0 && err==0)
err = rc;
}
#endif
return err;
}
#else
int dummy_uiq_udp;
#endif
long pj_ssize_t
Definition: types.h:64
int pj_bool_t
Definition: types.h:71
struct pj_ioqueue_t pj_ioqueue_t
Definition: types.h:210
long pj_sock_t
Definition: types.h:263
struct pj_ioqueue_key_t pj_ioqueue_key_t
Definition: types.h:216
int pj_status_t
Definition: types.h:68
struct pj_thread_t pj_thread_t
Definition: types.h:236
#define PJ_ARRAY_SIZE(a)
Definition: types.h:281
unsigned int pj_uint32_t
Definition: types.h:43
@ PJ_SUCCESS
Definition: types.h:93
@ PJ_TRUE
Definition: types.h:96
@ PJ_FALSE
Definition: types.h:99
pj_ioqueue_epoll_flag
Definition: ioqueue.h:337
void pj_ioqueue_op_key_init(pj_ioqueue_op_key_t *op_key, pj_size_t size)
pj_status_t pj_ioqueue_recvfrom(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, void *buffer, pj_ssize_t *length, pj_uint32_t flags, pj_sockaddr_t *addr, int *addrlen)
pj_status_t pj_ioqueue_create2(pj_pool_t *pool, pj_size_t max_fd, const pj_ioqueue_cfg *cfg, pj_ioqueue_t **ioqueue)
pj_status_t pj_ioqueue_destroy(pj_ioqueue_t *ioque)
pj_status_t pj_ioqueue_recv(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, void *buffer, pj_ssize_t *length, pj_uint32_t flags)
void * pj_ioqueue_get_user_data(pj_ioqueue_key_t *key)
pj_status_t pj_ioqueue_unregister(pj_ioqueue_key_t *key)
void pj_ioqueue_cfg_default(pj_ioqueue_cfg *cfg)
int pj_ioqueue_poll(pj_ioqueue_t *ioque, const pj_time_val *timeout)
pj_status_t pj_ioqueue_sendto(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, const void *data, pj_ssize_t *length, pj_uint32_t flags, const pj_sockaddr_t *addr, int addrlen)
pj_status_t pj_ioqueue_register_sock(pj_pool_t *pool, pj_ioqueue_t *ioque, pj_sock_t sock, void *user_data, const pj_ioqueue_callback *cb, pj_ioqueue_key_t **key)
const char * pj_ioqueue_name(void)
@ PJ_IOQUEUE_EPOLL_AUTO
Definition: ioqueue.h:351
@ PJ_IOQUEUE_EPOLL_ONESHOT
Definition: ioqueue.h:344
@ PJ_IOQUEUE_EPOLL_EXCLUSIVE
Definition: ioqueue.h:340
#define PJ_LOG(level, arg)
Definition: log.h:106
void * pj_pool_alloc(pj_pool_t *pool, pj_size_t size)
pj_pool_t * pj_pool_create(pj_pool_factory *factory, const char *name, pj_size_t initial_size, pj_size_t increment_size, pj_pool_callback *callback)
void pj_pool_release(pj_pool_t *pool)
pj_str_t pj_str(char *str)
int pj_memcmp(const void *buf1, const void *buf2, pj_size_t size)
Definition: string.h:823
char * pj_create_random_string(char *str, pj_size_t length)
const pj_str_t * pj_cstr(pj_str_t *str, const char *s)
Definition: string.h:100
void pj_bzero(void *dst, pj_size_t size)
Definition: string.h:762
pj_status_t pj_sock_bind(pj_sock_t sockfd, const pj_sockaddr_t *my_addr, int addrlen)
pj_status_t pj_sock_send(pj_sock_t sockfd, const void *buf, pj_ssize_t *len, unsigned flags)
pj_uint16_t pj_htons(pj_uint16_t hostshort)
pj_status_t pj_sock_close(pj_sock_t sockfd)
pj_in_addr pj_inet_addr2(const char *cp)
#define pj_AF_INET()
Definition: sock.h:113
pj_status_t pj_sock_sendto(pj_sock_t sockfd, const void *buf, pj_ssize_t *len, unsigned flags, const pj_sockaddr_t *to, int tolen)
#define pj_SOCK_DGRAM()
Definition: sock.h:162
#define PJ_INVALID_SOCKET
Definition: sock.h:485
pj_status_t pj_sock_getsockname(pj_sock_t sockfd, pj_sockaddr_t *addr, int *namelen)
#define pj_SOCK_STREAM()
Definition: sock.h:160
pj_status_t pj_sockaddr_in_init(pj_sockaddr_in *addr, const pj_str_t *cp, pj_uint16_t port)
pj_status_t pj_sock_socket(int family, int type, int protocol, pj_sock_t *sock)
pj_bool_t pj_symbianos_poll(int priority, int ms_timeout)
pj_status_t pj_thread_destroy(pj_thread_t *thread)
pj_status_t pj_thread_join(pj_thread_t *thread)
pj_status_t pj_thread_create(pj_pool_t *pool, const char *thread_name, pj_thread_proc *proc, void *arg, pj_size_t stack_size, unsigned flags, pj_thread_t **thread)
pj_status_t pj_thread_sleep(unsigned msec)
pj_status_t pj_gettickcount(pj_time_val *tv)
pj_status_t pj_get_timestamp(pj_timestamp *ts)
pj_uint32_t pj_elapsed_usec(const pj_timestamp *start, const pj_timestamp *stop)
#define PJ_TIME_VAL_MSEC(t)
Definition: types.h:421
#define pj_assert(expr)
Definition: assert.h:48
#define PJ_IOQUEUE_MAX_HANDLES
Definition: config.h:681
#define PJ_IOQUEUE_KEY_FREE_DELAY
Definition: config.h:742
#define PJ_UNUSED_ARG(arg)
Definition: config.h:1343
#define PJ_ERR_MSG_SIZE
Definition: errno.h:84
pj_str_t pj_strerror(pj_status_t statcode, char *buf, pj_size_t bufsize)
void pj_set_os_error(pj_status_t code)
#define PJ_PERROR(level, arg)
Definition: errno.h:175
#define PJ_STATUS_FROM_OS(e)
Definition: errno.h:275
pj_status_t pj_get_netos_error(void)
#define PJ_EPENDING
Definition: errno.h:322
#define PJ_ENOMEM
Definition: errno.h:347
Definition: udp_echo_srv_ioqueue.c:27
Definition: ioqueue.h:219
void(* on_read_complete)(pj_ioqueue_key_t *key, pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_read)
Definition: ioqueue.h:231
Definition: ioqueue.h:362
unsigned epoll_flags
Definition: ioqueue.h:370
pj_bool_t default_concurrency
Definition: ioqueue.h:379
Definition: ioqueue.h:208
void * user_data
Definition: ioqueue.h:211
pj_uint16_t sin_port
Definition: sock.h:541
pj_uint16_t sin_family
Definition: sock.h:539
pj_in_addr sin_addr
Definition: sock.h:542
long msec
Definition: types.h:402
long sec
Definition: types.h:399
pj_uint32_t lo
Definition: types.h:142
pj_uint32_t hi
Definition: types.h:141
struct pj_timestamp::@9 u32