coding with libevent