fix Interrupted system call when connecting to the remote server