Fix server socket stop check