libevent sample codes