better server closing and worker disconnecting
Merge pull request #7 from Offirmo/improve_shutdown_function

better server closing and worker disconnecting