Skip to content

Commit

Permalink
added errohandling in socketcomm.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@862 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Oct 14, 2002
1 parent 8a72c23 commit 23948aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mosh/src/mosh.cpp
Expand Up @@ -114,7 +114,17 @@ int main(int argc, char* argv[])
}
add_history(line);
int nbytes = write(sock,line,strlen(line)+1);
if (nbytes == 0) {
cout << "Error writing to server" << endl;
done = true;
break;
}
int recvbytes = read(sock,buf,40000);
if (recvbytes == 0) {
cout << "Recieved 0 bytes, exiting" << endl;
done = true;
break;
}
cout << buf;
free(line);
}
Expand Down

0 comments on commit 23948aa

Please sign in to comment.