checking for a dead MathLink connection
- To: mathgroup at smc.vnet.net
- Subject: [mg23543] checking for a dead MathLink connection
- From: Adalbert Hanssen <hanssen at Zeiss.de>
- Date: Sat, 20 May 2000 03:10:21 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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