tcp server based on libevent