add simple packet server implementation, removed typo and support handle_close