socket server now handles connection errors gracefully