Re: checking for a dead MathLink connection
- To: mathgroup at smc.vnet.net
- Subject: [mg23635] Re: checking for a dead MathLink connection
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 25 May 2000 01:00:45 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <8g5eed$g4b@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Albert, I think "Check[expr, failexpr] evaluates expr, and returns the result, unless \ messages were generated, in which case it evaluates and returns failexpr. \ Check[expr, failexpr, s1::t1, s2::t2, ... ] checks only for the specified \ messages." will help you. But in gerneral your MathLink connection must be alive until you terminatet it with Uninstall[] all other cases are an error of the MathLink child and must corrected in the MathLink program and *not* by the kernel. Regards Jens Adalbert Hanssen wrote: > > Hi, MathGroup, > > Links[] tells me, which MathLink connections were opened but not yet > closed until the command is issued. > > Links["file"] tells me, which MathLink connections to "file.exe" (on NT) > were opened but not yet closed until the command is issued. > > Both return a List of LinkObjects (or {}, if there is none). > > After Uninstall[link], the link designated by the parameter is closed > and after this, this connection is no longer reported by Links. > > If the other end of a MathLink connection "dies improperly", it is still > reported by Links. > > How can I tell, if a given link is alive? LinkReadyQ is not the right > one, as it tests, if there are data to be read from the link. There > must be some function, if you try to use a dead connection, you > get an error message > > LinkObject::linkn: "Argument LinkObject[....]... has an invalid > LinkObject number; the link may be dead." > > I just want the function which does the test resulting in the above > error message, but before it is put out. > > Kind regards > > Dipl.-Math. Adalbert Hanszen