implement all of bufferevent class