[Gmsh] message to socket

Christophe Geuzaine christophe.geuzaine at case.edu
Thu Feb 23 20:13:41 CET 2006


Jose M. Sancho wrote:
> Dear Christophe:
> 
> Thanks for the answer. 
> 
> to your first point:
> 
> I think you can actually already do that right now: just save a small 
> temporary file (e.g. "tmp.txt") that contains the options or any other 
> commands you want to execute, and call client.View("tmp.txt") after 
> client.View("solve.pos"): Gmsh will then just parse that file after 
> reading your view.
> 
> I do that in the enclosed source file and:
> 
> a.) If the temporary file tmp.txt is not closed, eg.: the user has the 
> editor always open with this file "ala console" to send different 
> commands, then Gmsh naturally locks. (In Macosx 10.4)

That does not surprise me too much. I think we should use something like
readline to send commands instead.

> 
> b.) I do not understand correctly the need to delay the socket answer by 
> means of the system command sleep(int). But without sleep, the new view 
> shows no difference with the previous. And with sleep(1) there is no 
> enough time to show the new frame.
>  

I don't quite understand this (I have the same behavior here).

Weird thing is, if I specify different filenames for each view, then it 
works (cf. attached file "SolverAsc.cpp"). There is probably a race 
condition somewhere in the socket stuff when the views are created that 
fast.



> 
> 
> Regards.
> 
> ------------------------------------------------------------------------
> 
> José M. Sancho
> 
> Professor of Structural Analysis
> 
> Universidad Politecnica de Madrid
> 
> ETS de Arquitectura
> 
> Avda. Juan de Herrera,4
> 
> 28040 Madrid, Spain
> 
> Tel. +34 91 336 65 16
> 
> Fax. +34 91 336 65 67
> 
> E-mail: jose.sancho at upm.es <mailto:jose.sancho at upm.es>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh


-- 
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SolverAsc.cpp
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20060223/1426cbd4/attachment.cpp>