Fix for connection closure/server restart and multiple clients