in reply to Re^4: Client-Server Programme hangs...
in thread Client-Server Programme hangs...

Then my only suggestion is to put some print statements in your server code, run it in a terminal, and make sure that the loop reading from $session actually exits when it should.