userdoc_companion.dox

来自「一个语言识别引擎」· DOX 代码 · 共 558 行 · 第 1/2 页

DOX
558
字号
telnet 172.16.232.1 10000
   # system responds...
   Trying 172.16.232.1...
   Connected to 172.16.232.1.
   Escape character is '^]'.
# user types...
NAME_SERVER list
   # system responds...
   registration name /read ip 172.16.232.1 port 10002 type tcp
   registration name root ip 172.16.232.1 port 10000 type text
   registration name fallback ip 224.2.1.1 port 10001 type mcast
   registration name /write ip 172.16.232.1 port 10012 type tcp
   *** end of message
# user types...
^]
   # system responds...
   telnet> quit
   Connection closed.
\endverbatim


\section name_help yarp name help

This will list the commands available from the name server.
For example, our current implementation gives:

\verbatim
Here are some ways to use the name server:
  NAME_SERVER register ...
  NAME_SERVER unregister ...
  NAME_SERVER query ...
  NAME_SERVER help ...
  NAME_SERVER set ...
  NAME_SERVER get ...
  NAME_SERVER check ...
  NAME_SERVER match ...
  NAME_SERVER list ...
  NAME_SERVER route ...
*** end of message
\endverbatim

\section name_query yarp name query

\verbatim
yarp name query PORT
\endverbatim

Requests registration information for the named port.  Response is of 
the following form:
\verbatim
registration name PORT ip ADDRESS port NUMBER type CARRIER
*** end of message
\endverbatim
For example:
\verbatim
registration name /write ip 5.255.112.227 port 10001 type tcp
*** end of message
\endverbatim
If there is no registration for the port, the registration line
is omitted, and instead the response is simply:
\verbatim
*** end of message
\endverbatim



\section name_register yarp name register

\verbatim
yarp name register PORT
yarp name register PORT CARRIER
yarp name register PORT CARRIER IP
yarp name register PORT CARRIER IP NUMBER
\endverbatim

Requests creation of registration information for the named port.  
Response is of the following form:
\verbatim
registration name PORT ip ADDRESS port NUMBER type CARRIER
*** end of message
\endverbatim
For example:
\verbatim
registration name /write ip 5.255.112.227 port 10001 type tcp
*** end of message
\endverbatim

Optionally, the user can take responsibility for more fields, 
such as the carrier, ip, and socket port number.
Any value (including the port name) can be replaced by ``...'' to leave it 
up to the name-server to choose it.  For example:
\verbatim
yarp name register ... tcp 127.0.0.1 8080
\endverbatim
Gives something of the form:
\verbatim
registration name /tmp/port/1 ip 127.0.0.1 port 8080 type tcp
*** end of message
\endverbatim
If you choose to set the ip yourself, be careful -- there is the 
possibility of problems with multiple ways to identify the same
machine.  It is best to let the name server choose a name,
which it should do in a consistent way.  If a machine has
multiple ip addresses on multiple networks, that can be 
handled -- see the 
discussion of the ips property in the section on "yarp name set".
That is important for the purposes of controlling which 
network is used for connections from one port to another.




\section name_unregister yarp name unregister

\verbatim
yarp name unregister PORT
\endverbatim

Removes registration information for the named port.  
Response is of the following form:
\verbatim
*** end of message
\endverbatim


\section name_list yarp name list

Gives registration information of all known ports.
Response is of the following form:
\verbatim
registration name /write ip 130.251.4.159 port 10021 type tcp
registration name /read ip 130.251.4.159 port 10031 type tcp
registration name /tmp/port/4 ip 130.251.4.159 port 10011 type tcp
registration name /tmp/port/3 ip 130.251.4.52 port 10021 type tcp
registration name /tmp/port/2 ip 130.251.4.52 port 10011 type tcp
registration name /tmp/port/1 ip 130.251.4.159 port 10001 type tcp
*** end of message
\endverbatim



\section name_set yarp name set

\verbatim
yarp name set PORT PROPERTY VALUE1 VALUE2 ...
\endverbatim

The name server can store extra properties of a port, beyond the
bare details associated with registration.  The  set command
is used to do this.  For example, the command:
\verbatim
yarp name set /write offers tcp udp mcast
\endverbatim
Gets the following response:
\verbatim
port /write property offers = tcp udp mcast
\endverbatim
The get and check commands can then be used to query
such properties.

There are some special properties used by YARP.  Property ``ips''
can list multiple identifiers of a machine.  Property ``offers''
lists carriers that an output port can support.  Propery ``accepts''
lists carriers that an input port can support.





\section name_get yarp name get

\verbatim
yarp name get PORT PROPERTY
\endverbatim

Gets the values of a stored property. For example, 
after the set command example shown earlier, the command:
\verbatim
yarp name get /write offers
\endverbatim
Returns the following response:
\verbatim
port /write property offers = tcp udp mcast
\endverbatim


\section name_check yarp name check

\verbatim
yarp name check PORT PROPERTY VALUE
\endverbatim

Checks if a stored property can take the given value. For example, 
after the set command example shown earlier, the command:
\verbatim
yarp name check /write offers tcp
\endverbatim
Returns the following response:
\verbatim
port /write property offers value tcp present true
\endverbatim


\section name_route yarp name route

\verbatim
yarp name route PORT1 PORT2
\endverbatim

Finds a good way to connect an output port to an input port, based
on the carriers they have in common (preferred carriers can optionally
be added to this command in decreasing order of preference) and
which carriers are physically possible (for example, `shmem'
requires ports to be on the same machine, and `local' requires
ports to belong to threads with a shared memory space).
For example, the command:
\verbatim
yarp name route /write /read
\endverbatim
Returns the following response:
\verbatim
port /write route /read = shmem://read
\endverbatim
This suggests that shmem is the best carrier to use.


\section companion_extended An extended example

Start five terminals, called A-E.  Do the following:
\verbatim
[in terminal A] yarp server
[in terminal B] yarp check
\endverbatim
Terminal B should run some tests, then say yarp is "ok".  Now
do the following, leaving terminal A untouched:
\verbatim
[in terminal B] yarp read /read
[in terminal C] yarp write /write verbatim /read
\endverbatim
Now type some stuff into terminal C and hit return.  That stuff
should be echoed on terminal B.  Now try:
\verbatim
[in terminal D] yarp disconnect /write /read
\endverbatim
Now if you type stuff in terminal C, it no longer appears on B.
Now try:
\verbatim
[in terminal D] yarp connect /write /read
\endverbatim
Now if you type stuff in terminal C, it appears on B again.

If you have the "yarpdev" and "yarpview" programs, we can go further.
Try:
\verbatim
[in terminal E] yarpdev --device test_grabber --period 2 --width 8 --height 8 --name /grabber
\endverbatim
This creates a test "device" with a port called "/grabber", outputing a
very small test image every 2 seconds.  You won't see much happen yet.
Try:
\verbatim
[in terminal D] yarpview --name /view &
[in terminal D] yarp connect /grabber /view
\endverbatim
You should now see a slow-moving red line.  Try:
\verbatim
[in terminal D] yarp connect /grabber /read
\endverbatim
You should now see a text representation of the image on terminal B
appearing every 2 seconds.

\if MAN_PAGE_COND
\else
yarpdev: @subpage yarpdev

yarpview: @subpage yarpview
\endif

*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?