diff --git a/Fltk/GmshServer.cpp b/Fltk/GmshServer.cpp index c6e782882860415f9d37534d32ac3d76aac29296..ce82f2e13469e9fb0a209a26b2d61b28ed9185f5 100644 --- a/Fltk/GmshServer.cpp +++ b/Fltk/GmshServer.cpp @@ -1,4 +1,4 @@ -/* $Id: GmshServer.cpp,v 1.25 2005-01-08 20:15:11 geuzaine Exp $ */ +/* $Id: GmshServer.cpp,v 1.26 2005-01-14 04:50:48 geuzaine Exp $ */ /* * Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle * @@ -30,10 +30,6 @@ * Christopher Stott */ -// This is a hacked version using the Gmsh function SystemCall() -// instead system() and using CTX.solver.max_delay in select() -#include "Context.h" -extern Context_T CTX; void SystemCall(char *str); #include <stdio.h> @@ -85,7 +81,7 @@ static int Socket_UnlinkName(char *name) /* public interface */ -int Gmsh_StartClient(char *command, char *sockname) +int Gmsh_StartClient(char *command, char *sockname, int maxdelay) { static int init = 0; static int s; @@ -104,8 +100,7 @@ int Gmsh_StartClient(char *command, char *sockname) /* no socket? launch the command! */ if(!sockname) { - //system(command); - SystemCall(command); + SystemCall(command); //system(command); return 1; } @@ -160,16 +155,14 @@ int Gmsh_StartClient(char *command, char *sockname) } /* Start the external function via system() call */ - //system(command); - SystemCall(command); + SystemCall(command); //system(command); /* wait for external function to connect */ if(listen(s, 20)) return -3; /* Error: Socket listen failed */ /* Watch s to see when it has input; wait up to N seconds */ - //tv.tv_sec = 4; - tv.tv_sec = CTX.solver.max_delay; + tv.tv_sec = maxdelay; tv.tv_usec = 0; FD_ZERO(&rfds); FD_SET(s, &rfds); diff --git a/Fltk/GmshServer.h b/Fltk/GmshServer.h index 13f0320c46e5a9883370d028fefd47a6d9f0276d..69aca24cd5454dc7265dad7fd6f7707d3b9faedc 100644 --- a/Fltk/GmshServer.h +++ b/Fltk/GmshServer.h @@ -29,7 +29,7 @@ * Please report all bugs and problems to <gmsh@geuz.org>. */ -int Gmsh_StartClient(char *command, char *sockname); +int Gmsh_StartClient(char *command, char *sockname, int maxdelay); int Gmsh_ReceiveString(int socket, int *type, char str[]); int Gmsh_StopClient(char *sockname, int socket); diff --git a/Fltk/Makefile b/Fltk/Makefile index cdd3886d4478837f11389ae3ece388f9b0006d76..6e7bf19d6f88301886c668c5e1610c37caf1f200 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.67 2005-01-13 23:39:10 geuzaine Exp $ +# $Id: Makefile,v 1.68 2005-01-14 04:50:48 geuzaine Exp $ # # Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle # @@ -150,7 +150,7 @@ Colorbar_Window.o: Colorbar_Window.cpp ../Common/Gmsh.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \ ../Mesh/Matrix.h Colorbar_Window.h ../Common/ColorTable.h \ ../Common/Context.h -GmshServer.o: GmshServer.cpp ../Common/Context.h ../DataStr/List.h +GmshServer.o: GmshServer.cpp Solvers.o: Solvers.cpp ../Common/Gmsh.h ../Common/Message.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h GmshServer.h ../Parser/OpenFile.h \ diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp index 22fd93f0465c1334a8842a1048248a7e8ed58ee1..79840820a9ca3c4cdeceab33f993d4a32f88a97c 100644 --- a/Fltk/Solvers.cpp +++ b/Fltk/Solvers.cpp @@ -1,4 +1,4 @@ -// $Id: Solvers.cpp,v 1.33 2005-01-14 01:40:49 geuzaine Exp $ +// $Id: Solvers.cpp,v 1.34 2005-01-14 04:50:48 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -70,7 +70,7 @@ int Solver(int num, char *args) #if !defined(WIN32) strcat(command, " &"); #endif - Gmsh_StartClient(command, NULL); + Gmsh_StartClient(command, NULL, CTX.solver.max_delay); return 1; } @@ -90,7 +90,7 @@ int Solver(int num, char *args) strcat(command, " &"); #endif - sock = Gmsh_StartClient(command, socket_name); + sock = Gmsh_StartClient(command, socket_name, CTX.solver.max_delay); if(sock < 0) { switch (sock) { case -1: