register for close event of httpServer