Socket server fixed, disconnection and new connections work.