📄 wtxtclcomm.html
字号:
<html><head><!-- /vobs/wpwr/docs/tornado-api/wtxtcl/wtxtclComm.html - generated by refgen from wtcomm.c --> <title> wtxtclComm [Tcl] </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>Tornado API Reference : WTX Tcl Library</i></a></p></blockquote><h1>wtxtclComm [Tcl]</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxtclComm [Tcl]</strong> - WTX Tcl calls related to target server communications</p></blockquote><h4>TCL PROCEDURES</h4><blockquote><p><p><b><a href="./wtxtclComm.html#wtxToolAttach">wtxToolAttach</a></b> - attach to a target server<br><b><a href="./wtxtclComm.html#wtxToolDetach">wtxToolDetach</a></b> - detach from a target server<br><b><a href="./wtxtclComm.html#wtxHandle">wtxHandle</a></b> - show the WTX handle stack or set the top element of the stack<br><b><a href="./wtxtclComm.html#wtxTimeout">wtxTimeout</a></b> - return or set the current WTX timeout<br><b><a href="./wtxtclComm.html#wtxPath">wtxPath</a></b> - return a pathname suitable for the environment<br><b><a href="./wtxtclComm.html#wtxHostType">wtxHostType</a></b> - get the host-type code for the current process<br><b><a href="./wtxtclComm.html#wtxTargetName">wtxTargetName</a></b> - return the name of the target server attached<br><b><a href="./wtxtclComm.html#wtxToolName">wtxToolName</a></b> - return the name of the current tool<br><b><a href="./wtxtclComm.html#wtxErrorHandler">wtxErrorHandler</a></b> - query or establish an error handler for a connection<br><b><a href="./wtxtclComm.html#msleep">msleep</a></b> - sleep for the specified number of milliseconds<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains routines that have to deal with the target servercommunications. Those routines allow to establish / configure / endcommunications with the target server to have access to the target through Tclcalls.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b><hr><a name="wtxToolAttach"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxToolAttach</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxToolAttach</strong> - attach to a target server</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxToolAttach <i>targetServerName</i> [<i>toolName</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command attaches to the named target server. It registers the callingprocess as a tool with the target server, supplying the <i>toolName</i> if given, or wtxtcl otherwise. The target server attached in this way becomes the "default" target server for all further WTX Tcl calls. EachWTX Tcl call may select an explicit connection with the <b>-hwtx</b> <i>handle</i> arguments, using the handle returned by this call in the place of <i>handle</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A WTX handle.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>out of virtual memory<dd>The tool cannot attach a target server because the host memory is exhausted.<p><dt>virtual memory exhausted<dd> The tool cannot attach a target server because the host memory is exhausted.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxToolDetach<hr><a name="wtxToolDetach"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxToolDetach</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxToolDetach</strong> - detach from a target server</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxToolDetach [<i>handle</i> | -all] </pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command detaches from the target server at the top of the target serverstack. If a <i>handle</i> argument is given, that connection is detachedregardless of its position in the stack. If <b>-all</b> is given, all WTX connections on the stack are destroyed.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>WTX handle not found<dd>The tool cannot detach, probably because it was not attached yet.<p><dt>no connection stack is associated with this interpreter<dd> At least one connection handle cannot be closed.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxToolAttach<hr><a name="wtxHandle"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxHandle</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxHandle</strong> - show the WTX handle stack or set the top element of the stack</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxHandle [<i>handle</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>With no arguments, wtxHandle will return the stack of WTXconnection handles in list form. The first element of the list is the top of the stack. If a <i>handle</i> is given as an argument, that handlewill be pulled to the top of the stack; it will then become the defaulthandle for WTX Tcl operations.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>WTX handle not found<dd>The WTX handle stack cannot be popped.<p><dt>no connection stack is associated with this interpreter<dd> At least one connection handle cannot be closed.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxToolAttach, wtxToolDetach<hr><a name="wtxTimeout"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxTimeout</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxTimeout</strong> - return or set the current WTX timeout</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxTimeout [-hwtx <i>handle</i>] [<i>seconds</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>With no argument, the current WTX timeout in seconds (and fractions thereof,if the timeout has been set by an application rather than this call) is returned. If an argument is given, the timeout is set to that number of <i>seconds</i>.<p>The timeout of the default WTX connection is returned or modified if <b>-hwtx</b>is not given; otherwise, the timeout of the named connection is used.<p></blockquote><h4>ERRORS</h4><blockquote><p><dl><dt>bad timeout value<dd>A null or negative timeout value has been requested.<p><dt>No WTX connection<dd> No target server is attached at the present time.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxTargetName, wtxToolName, wtxToolAttach<hr><a name="wtxPath"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxPath</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxPath</strong> - return a pathname suitable for the environment</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxPath [<i>element</i>...]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>With no argument, this function returns the root directory of the Tornado tree. The format of the directory name is the usual one for the host operating system where wtxtcl is running. Optional <i>elements</i> are appended to the result, each separated with the local directory separator character. The special element <b>%H</b> is replaced by the canonicalname of the host where wtxtcl is running, and can be used to get a path to host-dependent material in the Tornado tree.<p></blockquote><h4>UNIX NOTES</h4><blockquote><p>On UNIX hosts, the root of the Tornado tree is the value of the environment variable <b>WIND_BASE</b>. <b>%H</b> is replaced by the name of thehost architecture and operating system, e.g., <b>sun4-sunos4</b>, and directory elements are separated with forward slashes. The end of thepath has a slash appended.<p></blockquote><h4>ERROR</h4><blockquote><p><dl><dt><b>WIND_BASE</b> is not set<dd> No <b>WIND_BASE</b> environment variable has been set.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxTargetName, wtxToolName, wtxToolAttach, wtxHostType<hr><a name="wtxHostType"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxHostType</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxHostType</strong> - get the host-type code for the current process</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxHostType </pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command returns the host type of the interpreter executing the Tcl code(for example, <b>sun4-sunos4</b>). <p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, wtxtcl, wtxPath<hr><a name="wtxTargetName"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxTargetName</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxTargetName</strong> - return the name of the target server attached</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxTargetName</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function returns the name of the default target server, if one is attached.<p></blockquote><h4>ERROR</h4><blockquote><p><dl><dt>No WTX connection<dd> No target server is attached at this time.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl<hr><a name="wtxToolName"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxToolName</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxToolName</strong> - return the name of the current tool</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxToolName</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command returns the tool name under which the wtxtcl application is registered with the target server, if the application is connected to one. Otherwise, it returns an empty string.<p></blockquote><h4>ERROR</h4><blockquote><p><dl><dt>No WTX connection<dd> No target server is attached at this time.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxTargetName<hr><a name="wtxErrorHandler"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>wtxErrorHandler</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>wtxErrorHandler</strong> - query or establish an error handler for a connection</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>wtxErrorHandler <i>handle</i> [[<i>proc</i>] <i>tag</i>]</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>If this function is called with a <i>handle</i> argument only, it returns the name of the Tcl procedure that is installed to handle WTX errors, if any. If <i>proc</i> is given, that Tcl procedure will be invoked whenever a WTX Tcl function that communicates with the target server raises an error.<p></blockquote><h4>ERROR HANDLER PROCEDURES</h4><blockquote><p>An error handling procedure should be written to take four arguments:the WTX handle in whose context the error occurred; the command that stimulated the error (in the form of a list); the error message generated;and a tag. The tag argument of the error handler procedure is set to the value of the <i>tag</i> argument given in the wtxErrorHandler command when the handler was attached. If <i>proc</i> is the empty string, any existingerror handler is cancelled (and in this case <i>tag</i> is ignored).<p></blockquote><h4>THE ROLE OF AN ERROR HANDLER</h4><blockquote><p>Error handlers should always <i>resubmit</i> errors that they do notdeal with so that Tcl application code that uses the <b>catch</b> command to process errors will not be disturbed. If an error handler has successfully dealt with an error, it should returna value of the sort expected by the command that stimulated the error. While it is possible to signal an error other than the one the commandgenerated, this may confuse the application code logic by introducingan unexpected error type.<p></blockquote><h4>CHAINING ERROR HANDLERS</h4><blockquote><p>Before installing a new error handler, it may good idea to use the query form of the command to see if an error handler already exists.If so, construct a command that invokes the new error handlerfollowed by the existing one, and install that new command as the error handler.<p></blockquote><h4>ERROR</h4><blockquote><p><dl><dt>WTX handle not found<dd> The user named an invalid handle.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl, wtxTargetName<hr><a name="msleep"></a><p align=right><a href="rtnIndex.html"><i>WTX Tcl Library : Tcl Procedures</i></a></p></blockquote><h1>msleep</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msleep</strong> - sleep for the specified number of milliseconds</p><p></blockquote><h4>LOCALE</h4><blockquote><p>WTX Tcl<p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>msleep <i>milliseconds</i></pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function pauses execution of the program for the specified numberof milliseconds.<p></blockquote><h4>UNIX NOTES</h4><blockquote><p>The timer is implemented using the <b><i><a href="../../vxworks/ref/selectLib.html#select" >select</a></i>( )</b> system call and is not very accurate for small sleep times. No attempt is made to calibratethe delay to take into account the overhead of the Tcl evaluation.You can test the accuracy of the timing in your environment with Tcl's<b>time</b> command:<p><pre>wtxtcl.ex>time {msleep 50} 10049944 microseconds per iteration</pre>In this test, according to Tcl's timing support, the call is accurate to -0.11% for a sleep duration of 50 msec.<p></blockquote><h4>ERROR</h4><blockquote><p><dl><dt>invalid time<dd> A NULL or negative value has been asked for.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./wtxtclComm.html#top">wtxtclComm</a></b>, * wtxtcl</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -