Skip to content
Snippets Groups Projects
Commit c7253cd6 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

catch more sendrecv errors + increase get() timout to 5 minutes

parent ea454c77
No related branches found
No related tags found
No related merge requests found
......@@ -87,16 +87,18 @@ class GmshSocket{
// the socket name
std::string _sockname;
// send some data over the socket
void _SendData(const void *buffer, int bytes)
int _SendData(const void *buffer, int bytes)
{
const char *buf = (const char *)buffer;
int sofar = 0;
int remaining = bytes;
do {
int len = send(_sock, buf + sofar, remaining, 0);
if(len < 0) return -1; // error
sofar += len;
remaining -= len;
} while(remaining > 0);
return bytes;
}
// receive some data over the socket
int _ReceiveData(void *buffer, int bytes)
......
......@@ -743,8 +743,8 @@ namespace onelab{
_gmshClient->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, msg.size(), &msg[0]);
while(1){
// stop if we have no communications for 10 secs
int ret = _gmshClient->Select(10, 0);
// stop if we have no communications for 5 minutes
int ret = _gmshClient->Select(500, 0);
if(!ret){
_gmshClient->Info("Timout: aborting remote get");
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment