dw_fluffos_v1/
dw_fluffos_v1/fluffos-1.22c11/
dw_fluffos_v1/fluffos-1.22c11/ChangeLog.old/
dw_fluffos_v1/fluffos-1.22c11/Win32/
dw_fluffos_v1/fluffos-1.22c11/compat/
dw_fluffos_v1/fluffos-1.22c11/compat/simuls/
dw_fluffos_v1/fluffos-1.22c11/include/
dw_fluffos_v1/fluffos-1.22c11/mudlib/
dw_fluffos_v1/fluffos-1.22c11/testsuite/
dw_fluffos_v1/fluffos-1.22c11/testsuite/clone/
dw_fluffos_v1/fluffos-1.22c11/testsuite/command/
dw_fluffos_v1/fluffos-1.22c11/testsuite/data/
dw_fluffos_v1/fluffos-1.22c11/testsuite/etc/
dw_fluffos_v1/fluffos-1.22c11/testsuite/include/
dw_fluffos_v1/fluffos-1.22c11/testsuite/inherit/
dw_fluffos_v1/fluffos-1.22c11/testsuite/inherit/master/
dw_fluffos_v1/fluffos-1.22c11/testsuite/log/
dw_fluffos_v1/fluffos-1.22c11/testsuite/single/
dw_fluffos_v1/fluffos-1.22c11/testsuite/single/tests/compiler/
dw_fluffos_v1/fluffos-1.22c11/testsuite/single/tests/efuns/
dw_fluffos_v1/fluffos-1.22c11/testsuite/single/tests/operators/
dw_fluffos_v1/fluffos-1.22c11/testsuite/u/
dw_fluffos_v1/fluffos-1.22c11/tmp/
dw_fluffos_v1/lib/
dw_fluffos_v1/lib/binaries/cmds/
dw_fluffos_v1/lib/binaries/cmds/creator/
dw_fluffos_v1/lib/binaries/cmds/living/
dw_fluffos_v1/lib/binaries/cmds/player/
dw_fluffos_v1/lib/binaries/d/admin/obj/
dw_fluffos_v1/lib/binaries/d/liaison/
dw_fluffos_v1/lib/binaries/global/virtual/
dw_fluffos_v1/lib/binaries/global/virtual/setup_compiler/
dw_fluffos_v1/lib/binaries/obj/handlers/autodoc/
dw_fluffos_v1/lib/binaries/obj/handlers/terrain_things/
dw_fluffos_v1/lib/binaries/obj/misc/
dw_fluffos_v1/lib/binaries/obj/misc/buckets/
dw_fluffos_v1/lib/binaries/obj/monster/
dw_fluffos_v1/lib/binaries/obj/reactions/
dw_fluffos_v1/lib/binaries/obj/reagents/
dw_fluffos_v1/lib/binaries/secure/cmds/creator/
dw_fluffos_v1/lib/binaries/secure/master/
dw_fluffos_v1/lib/binaries/std/
dw_fluffos_v1/lib/binaries/std/dom/
dw_fluffos_v1/lib/binaries/std/effects/object/
dw_fluffos_v1/lib/binaries/std/guilds/
dw_fluffos_v1/lib/binaries/std/languages/
dw_fluffos_v1/lib/binaries/std/races/
dw_fluffos_v1/lib/binaries/std/room/
dw_fluffos_v1/lib/binaries/std/room/basic/
dw_fluffos_v1/lib/binaries/std/shops/
dw_fluffos_v1/lib/binaries/std/shops/inherit/
dw_fluffos_v1/lib/binaries/www/
dw_fluffos_v1/lib/cmds/guild-race/
dw_fluffos_v1/lib/cmds/guild-race/crafts/
dw_fluffos_v1/lib/cmds/guild-race/other/
dw_fluffos_v1/lib/cmds/playtester/
dw_fluffos_v1/lib/cmds/playtester/senior/
dw_fluffos_v1/lib/d/admin/
dw_fluffos_v1/lib/d/admin/log/
dw_fluffos_v1/lib/d/admin/mapper/31-10-01/mapmaker/event/
dw_fluffos_v1/lib/d/admin/meetings/
dw_fluffos_v1/lib/d/admin/obj/
dw_fluffos_v1/lib/d/admin/room/we_care/
dw_fluffos_v1/lib/d/admin/save/
dw_fluffos_v1/lib/d/dist/
dw_fluffos_v1/lib/d/dist/mtf/
dw_fluffos_v1/lib/d/dist/pumpkin/
dw_fluffos_v1/lib/d/dist/pumpkin/chars/
dw_fluffos_v1/lib/d/dist/pumpkin/desert/
dw_fluffos_v1/lib/d/dist/pumpkin/gumboot/
dw_fluffos_v1/lib/d/dist/pumpkin/hospital/
dw_fluffos_v1/lib/d/dist/pumpkin/inherit/
dw_fluffos_v1/lib/d/dist/pumpkin/map/
dw_fluffos_v1/lib/d/dist/pumpkin/plain/
dw_fluffos_v1/lib/d/dist/pumpkin/pumpkin/
dw_fluffos_v1/lib/d/dist/pumpkin/save/
dw_fluffos_v1/lib/d/dist/pumpkin/squash/
dw_fluffos_v1/lib/d/dist/pumpkin/terrain/
dw_fluffos_v1/lib/d/dist/pumpkin/woods/
dw_fluffos_v1/lib/d/dist/start/
dw_fluffos_v1/lib/d/learning/TinyTown/buildings/
dw_fluffos_v1/lib/d/learning/TinyTown/map/
dw_fluffos_v1/lib/d/learning/TinyTown/roads/
dw_fluffos_v1/lib/d/learning/add_command/
dw_fluffos_v1/lib/d/learning/arms_and_weps/
dw_fluffos_v1/lib/d/learning/chars/
dw_fluffos_v1/lib/d/learning/cutnpaste/
dw_fluffos_v1/lib/d/learning/examples/npcs/
dw_fluffos_v1/lib/d/learning/examples/player_houses/npcs/
dw_fluffos_v1/lib/d/learning/examples/terrain_map/basic/
dw_fluffos_v1/lib/d/learning/functions/
dw_fluffos_v1/lib/d/learning/handlers/
dw_fluffos_v1/lib/d/learning/help_topics/npcs/
dw_fluffos_v1/lib/d/learning/help_topics/objects/
dw_fluffos_v1/lib/d/learning/help_topics/rcs_demo/
dw_fluffos_v1/lib/d/learning/help_topics/rooms/
dw_fluffos_v1/lib/d/learning/help_topics/rooms/crowd/
dw_fluffos_v1/lib/d/learning/help_topics/rooms/situations/
dw_fluffos_v1/lib/d/learning/items/
dw_fluffos_v1/lib/d/learning/save/
dw_fluffos_v1/lib/d/liaison/
dw_fluffos_v1/lib/d/liaison/NEWBIE/doc/
dw_fluffos_v1/lib/d/liaison/NEWBIE/save/oldlog/
dw_fluffos_v1/lib/db/
dw_fluffos_v1/lib/doc/
dw_fluffos_v1/lib/doc/creator/
dw_fluffos_v1/lib/doc/creator/autodoc/include/reaction/
dw_fluffos_v1/lib/doc/creator/autodoc/include/ritual_system/
dw_fluffos_v1/lib/doc/creator/autodoc/include/talker/
dw_fluffos_v1/lib/doc/creator/autodoc/include/terrain_map/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/baggage/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/clock/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/clothing/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/cont_save/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/corpse/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/money/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/monster/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/scabbard/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/service_provider/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/state_changer/
dw_fluffos_v1/lib/doc/creator/autodoc/obj/wand/
dw_fluffos_v1/lib/doc/creator/autodoc/std/book_dir/
dw_fluffos_v1/lib/doc/creator/autodoc/std/key/
dw_fluffos_v1/lib/doc/creator/autodoc/std/learning/
dw_fluffos_v1/lib/doc/creator/autodoc/std/map/
dw_fluffos_v1/lib/doc/creator/autodoc/std/race/
dw_fluffos_v1/lib/doc/creator/autodoc/std/weapon_logic/
dw_fluffos_v1/lib/doc/creator/files/
dw_fluffos_v1/lib/doc/creator/policy/
dw_fluffos_v1/lib/doc/creator/room/
dw_fluffos_v1/lib/doc/effects/
dw_fluffos_v1/lib/doc/ideas/
dw_fluffos_v1/lib/doc/known_command/
dw_fluffos_v1/lib/doc/lpc/basic_manual/
dw_fluffos_v1/lib/doc/lpc/intermediate/
dw_fluffos_v1/lib/doc/new/add_command/
dw_fluffos_v1/lib/doc/new/handlers/
dw_fluffos_v1/lib/doc/new/living/
dw_fluffos_v1/lib/doc/new/living/race/
dw_fluffos_v1/lib/doc/new/living/spells/
dw_fluffos_v1/lib/doc/new/player/
dw_fluffos_v1/lib/doc/new/room/guild/
dw_fluffos_v1/lib/doc/new/room/outside/
dw_fluffos_v1/lib/doc/new/room/storeroom/
dw_fluffos_v1/lib/doc/object/
dw_fluffos_v1/lib/doc/playtesters/
dw_fluffos_v1/lib/doc/policy/
dw_fluffos_v1/lib/doc/weapons/
dw_fluffos_v1/lib/global/handlers/
dw_fluffos_v1/lib/global/virtual/setup_compiler/
dw_fluffos_v1/lib/include/
dw_fluffos_v1/lib/include/cmds/
dw_fluffos_v1/lib/include/effects/
dw_fluffos_v1/lib/include/npc/
dw_fluffos_v1/lib/include/shops/
dw_fluffos_v1/lib/net/daemon/chars/
dw_fluffos_v1/lib/net/inherit/
dw_fluffos_v1/lib/net/intermud3/
dw_fluffos_v1/lib/net/intermud3/services/
dw_fluffos_v1/lib/net/obj/
dw_fluffos_v1/lib/net/save/
dw_fluffos_v1/lib/net/smnmp/
dw_fluffos_v1/lib/net/snmp/
dw_fluffos_v1/lib/obj/amulets/
dw_fluffos_v1/lib/obj/b_day/
dw_fluffos_v1/lib/obj/examples/
dw_fluffos_v1/lib/obj/food/alcohol/
dw_fluffos_v1/lib/obj/food/chocolates/
dw_fluffos_v1/lib/obj/food/fruits/
dw_fluffos_v1/lib/obj/food/meat/
dw_fluffos_v1/lib/obj/food/nuts/
dw_fluffos_v1/lib/obj/food/seafood/
dw_fluffos_v1/lib/obj/food/vegetables/
dw_fluffos_v1/lib/obj/fungi/
dw_fluffos_v1/lib/obj/furnitures/artwork/
dw_fluffos_v1/lib/obj/furnitures/bathroom/
dw_fluffos_v1/lib/obj/furnitures/beds/
dw_fluffos_v1/lib/obj/furnitures/cabinets/
dw_fluffos_v1/lib/obj/furnitures/chairs/
dw_fluffos_v1/lib/obj/furnitures/chests/
dw_fluffos_v1/lib/obj/furnitures/clocks/
dw_fluffos_v1/lib/obj/furnitures/crockery/
dw_fluffos_v1/lib/obj/furnitures/cupboards/
dw_fluffos_v1/lib/obj/furnitures/cushions/
dw_fluffos_v1/lib/obj/furnitures/fake_plants/
dw_fluffos_v1/lib/obj/furnitures/lamps/
dw_fluffos_v1/lib/obj/furnitures/mirrors/
dw_fluffos_v1/lib/obj/furnitures/outdoor/
dw_fluffos_v1/lib/obj/furnitures/safes/
dw_fluffos_v1/lib/obj/furnitures/shelves/
dw_fluffos_v1/lib/obj/furnitures/sideboards/
dw_fluffos_v1/lib/obj/furnitures/sofas/
dw_fluffos_v1/lib/obj/furnitures/stoves/
dw_fluffos_v1/lib/obj/furnitures/tables/
dw_fluffos_v1/lib/obj/furnitures/wardrobes/
dw_fluffos_v1/lib/obj/handlers/
dw_fluffos_v1/lib/obj/handlers/autodoc/
dw_fluffos_v1/lib/obj/jewellery/anklets/
dw_fluffos_v1/lib/obj/jewellery/bracelets/
dw_fluffos_v1/lib/obj/jewellery/earrings/
dw_fluffos_v1/lib/obj/jewellery/misc/
dw_fluffos_v1/lib/obj/jewellery/necklaces/
dw_fluffos_v1/lib/obj/jewellery/rings/
dw_fluffos_v1/lib/obj/media/
dw_fluffos_v1/lib/obj/misc/buckets/
dw_fluffos_v1/lib/obj/misc/jars/
dw_fluffos_v1/lib/obj/misc/papers/
dw_fluffos_v1/lib/obj/misc/player_shop/
dw_fluffos_v1/lib/obj/misc/shops/
dw_fluffos_v1/lib/obj/misc/traps/
dw_fluffos_v1/lib/obj/monster/
dw_fluffos_v1/lib/obj/monster/godmother/
dw_fluffos_v1/lib/obj/monster/transport/
dw_fluffos_v1/lib/obj/plants/inherit/
dw_fluffos_v1/lib/obj/potions/
dw_fluffos_v1/lib/open/boards/
dw_fluffos_v1/lib/save/autodoc/
dw_fluffos_v1/lib/save/bank_accounts/
dw_fluffos_v1/lib/save/boards/frog/
dw_fluffos_v1/lib/save/books/bed_catalog/
dw_fluffos_v1/lib/save/creators/
dw_fluffos_v1/lib/save/mail/
dw_fluffos_v1/lib/save/mail/p/
dw_fluffos_v1/lib/save/newsrc/b/
dw_fluffos_v1/lib/save/newsrc/c/
dw_fluffos_v1/lib/save/newsrc/d/
dw_fluffos_v1/lib/save/newsrc/f/
dw_fluffos_v1/lib/save/newsrc/p/
dw_fluffos_v1/lib/save/newsrc/s/
dw_fluffos_v1/lib/save/newsrc/w/
dw_fluffos_v1/lib/save/players/c/
dw_fluffos_v1/lib/save/players/d/
dw_fluffos_v1/lib/save/players/g/
dw_fluffos_v1/lib/save/players/p/
dw_fluffos_v1/lib/save/players/s/
dw_fluffos_v1/lib/save/soul/data/
dw_fluffos_v1/lib/save/tasks/
dw_fluffos_v1/lib/save/vaults/
dw_fluffos_v1/lib/secure/cmds/lord/
dw_fluffos_v1/lib/secure/config/
dw_fluffos_v1/lib/secure/items/
dw_fluffos_v1/lib/secure/player/
dw_fluffos_v1/lib/soul/
dw_fluffos_v1/lib/soul/i/
dw_fluffos_v1/lib/soul/j/
dw_fluffos_v1/lib/soul/k/
dw_fluffos_v1/lib/soul/o/
dw_fluffos_v1/lib/soul/q/
dw_fluffos_v1/lib/soul/to_approve/
dw_fluffos_v1/lib/soul/u/
dw_fluffos_v1/lib/soul/v/
dw_fluffos_v1/lib/soul/wish_list/
dw_fluffos_v1/lib/soul/y/
dw_fluffos_v1/lib/soul/z/
dw_fluffos_v1/lib/std/creator/
dw_fluffos_v1/lib/std/effects/
dw_fluffos_v1/lib/std/effects/attached/
dw_fluffos_v1/lib/std/effects/external/
dw_fluffos_v1/lib/std/effects/fighting/
dw_fluffos_v1/lib/std/effects/other/
dw_fluffos_v1/lib/std/environ/
dw_fluffos_v1/lib/std/guilds/
dw_fluffos_v1/lib/std/hospital/
dw_fluffos_v1/lib/std/house/
dw_fluffos_v1/lib/std/house/onebedhouse/
dw_fluffos_v1/lib/std/house/onebedhut/
dw_fluffos_v1/lib/std/house/tworoomflat/
dw_fluffos_v1/lib/std/languages/
dw_fluffos_v1/lib/std/liquids/
dw_fluffos_v1/lib/std/nationality/
dw_fluffos_v1/lib/std/nationality/accents/
dw_fluffos_v1/lib/std/nationality/accents/national/
dw_fluffos_v1/lib/std/nationality/accents/regional/
dw_fluffos_v1/lib/std/npc/goals/
dw_fluffos_v1/lib/std/npc/goals/basic/
dw_fluffos_v1/lib/std/npc/goals/misc/
dw_fluffos_v1/lib/std/npc/inherit/
dw_fluffos_v1/lib/std/npc/plans/
dw_fluffos_v1/lib/std/npc/plans/basic/
dw_fluffos_v1/lib/std/outsides/
dw_fluffos_v1/lib/std/races/shadows/
dw_fluffos_v1/lib/std/room/basic/topography/
dw_fluffos_v1/lib/std/room/controller/
dw_fluffos_v1/lib/std/room/controller/topography/
dw_fluffos_v1/lib/std/room/furniture/games/
dw_fluffos_v1/lib/std/room/furniture/inherit/
dw_fluffos_v1/lib/std/room/inherit/carriage/
dw_fluffos_v1/lib/std/room/inherit/topography/
dw_fluffos_v1/lib/std/room/punishments/
dw_fluffos_v1/lib/std/room/topography/area/
dw_fluffos_v1/lib/std/room/topography/iroom/
dw_fluffos_v1/lib/std/room/topography/milestone/
dw_fluffos_v1/lib/std/shadows/
dw_fluffos_v1/lib/std/shadows/attached/
dw_fluffos_v1/lib/std/shadows/curses/
dw_fluffos_v1/lib/std/shadows/disease/
dw_fluffos_v1/lib/std/shadows/fighting/
dw_fluffos_v1/lib/std/shadows/room/
dw_fluffos_v1/lib/std/shops/controllers/
dw_fluffos_v1/lib/std/shops/objs/
dw_fluffos_v1/lib/std/shops/player_shop/
dw_fluffos_v1/lib/std/shops/player_shop/office_code/
dw_fluffos_v1/lib/std/socket/
dw_fluffos_v1/lib/www/
dw_fluffos_v1/lib/www/external/autodoc/
dw_fluffos_v1/lib/www/external/java/telnet/Documentation/
dw_fluffos_v1/lib/www/external/java/telnet/Documentation/images/
dw_fluffos_v1/lib/www/external/java/telnet/examples/
dw_fluffos_v1/lib/www/external/java/telnet/tools/
dw_fluffos_v1/lib/www/pics/
dw_fluffos_v1/lib/www/secure/creator/
dw_fluffos_v1/lib/www/secure/editors/
dw_fluffos_v1/lib/www/secure/survey_results/
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Mon Feb 23 10:46:39 CET 1998 -->
<a name="_top_"></a>
<title>
  Class socket.TelnetWrapper
</title>
</head>
<body>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-socket.html">This Package</a>  <a href="socket.TelnetIO.html#_top_">Previous</a>  <a href="Package-socket.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class socket.TelnetWrapper
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----socket.TelnetWrapper
</pre>
<hr>
<dl>
  <dt> public class <b>TelnetWrapper</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
Wrapper for a Java Telnet call. 
To use, make a new TelnetWrapper() with the name or IP address of a host.
Then, for most uses, the easiest way is to call setPrompt() with the
expected prompt, then call login(), and a sequence of sendLine()'s
until you get what you want done.
<P>
If you don't know the prompt ahead of time, you have to do a sequence of
send() and wait() or receiveUntil() calls.  send() sends a string across
the telnet connection. Add a '\r' to the end if you want to
complete a command. wait() waits for an exact string from the other side
of the telnet connection, and returns nothing,
receiveUntil() also waits for a string, but returns all the data
that it received while waiting, including the string itself. 
Use this if you want the output from a command. Please note that
the telnet connection will usually echo the sent command. 
<P>
sendLine() is generally better, since it adds the '\r'
automatically, waits for the prompt before returning, and returns all
data received before the prompt, with the prompt itself cut off the
end, and the sent command cut off the beginning. login() and
sendLine() are implemented using send(), wait() and receiveUntil().
They can be freely mixed and matched.
<P>
Here is a simple example of the use of TelnetWrapper:
<PRE>
// creates a new file in /tmp, lists the directory to prove it done
{
  TelnetWrapper telnet = new TelnetWrapper("123.45.78.90");
  // setting the correct prompt ahead of time is very important 
  // if you want to use login and sendLine
  telnet.setPrompt("$ ");
  telnet.login("loginname", "password");
  // this is how you have to do it otherwise
  telnet.send("touch /tmp/TELNET_WRAPPER" + "\r");
  telnet.wait("$ ");
  // sendLine 1: adds the \r automatically, 2: waits for the prompt
  // before returning 3: returns what was printed from the command
  String ls = telnet.sendLine("ls /tmp");
  System.out.println(ls);
  // clean up
  telnet.disconnect();
} 
</PRE>
<dl>
  <dt> <b>Version:</b>
  <dd> 0.2 5/15/97 - added comments, replaced String += with
   StringBuffer.append() in receiveUntil(), added port constructor
  <dt> <b>Author:</b>
  <dd> George Ruban 3/4/97
    <dt> <b>See Also:</b>
    <dd> <a href="socket.TelnetIO.html#_top_">TelnetIO</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#debug"><b>debug</b></a>
  <dd> Set to true for System.out.println debugging.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#TelnetWrapper(java.lang.String)"><b>TelnetWrapper</b></a>(String)
  <dd> Connects to the default telnet port on the given host.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#TelnetWrapper(java.lang.String, int)"><b>TelnetWrapper</b></a>(String, int)
  <dd> Connects to a specific telnet port on the given host.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#available()"><b>available</b></a>()
  <dd> Returns bytes available to be read.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#disconnect()"><b>disconnect</b></a>()
  <dd> Ends the telnet connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#finalize()"><b>finalize</b></a>()
  <dd> Ends the telnet connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#login(java.lang.String, java.lang.String)"><b>login</b></a>(String, String)
  <dd> Logs in as a particular user and password.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#main(java.lang.String[])"><b>main</b></a>(String[])
  <dd> Telnet test driver.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#receive()"><b>receive</b></a>()
  <dd> Returns a String from the telnet connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#receiveBytes()"><b>receiveBytes</b></a>()
  <dd> Returns a byte array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#receiveUntil(java.lang.String)"><b>receiveUntil</b></a>(String)
  <dd> Returns all data received up until a certain token.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#receiveUntil(java.lang.String, long)"><b>receiveUntil</b></a>(String, long)
  <dd> Returns all data received up until a certain token.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#send(byte[])"><b>send</b></a>(byte[])
  <dd> Sends bytes over the telnet connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#send(java.lang.String)"><b>send</b></a>(String)
  <dd> Sends a String to the remote host.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#sendLine(java.lang.String)"><b>sendLine</b></a>(String)
  <dd> Sends a line to the remote host, returns all data before the prompt.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDefaultPrompt(java.lang.String)"><b>setDefaultPrompt</b></a>(String)
  <dd> Sets the default prompt used by all TelnetWrappers.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setLogin(java.lang.String, java.lang.String)"><b>setLogin</b></a>(String, String)
  <dd> Sets the default login used by TelnetWrappers.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setPrompt(java.lang.String)"><b>setPrompt</b></a>(String)
  <dd> Sets the expected prompt.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#unsetLogin()"><b>unsetLogin</b></a>()
  <dd> Turns off the default login of TelnetWrappers.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#wait(java.lang.String)"><b>wait</b></a>(String)
  <dd> Skip any received data until the token appears.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#wait(java.lang.String, long)"><b>wait</b></a>(String, long)
  <dd> Wait for a String or a timeout.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="debug"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>debug</b>
<pre>
  public boolean debug
</pre>
<dl>
  <dd> Set to true for System.out.println debugging.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="TelnetWrapper"></a>
<a name="TelnetWrapper(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>TelnetWrapper</b>
<pre>
  public TelnetWrapper(<a href="java.lang.String.html#_top_">String</a> host) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Connects to the default telnet port on the given host. 
If the defaultLogin and defaultPassword are non-null, attempts login.
</dl>
<a name="TelnetWrapper(java.lang.String, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>TelnetWrapper</b>
<pre>
  public TelnetWrapper(<a href="java.lang.String.html#_top_">String</a> host,
                       int port) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Connects to a specific telnet port on the given host. 
If the defaultLogin and defaultPassword are non-null, attempts login.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="wait(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="wait"><b>wait</b></a>
<pre>
  public void wait(<a href="java.lang.String.html#_top_">String</a> token) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Skip any received data until the token appears. 
More efficient than receiveUntil, but liable to fail on large
tokens that can be spread over several "send"s. In that case,
consider using receiveUntil and ignoring the return value.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> token - String to wait for
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> on problems with the socket connection
    <dt> <b>See Also:</b>
    <dd> <a href="#receiveUntil">receiveUntil</a>
  </dl>
</dl>
<a name="wait(java.lang.String, long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="wait"><b>wait</b></a>
<pre>
  public void wait(<a href="java.lang.String.html#_top_">String</a> token,
                   long timeout) throws <a href="java.io.IOException.html#_top_">IOException</a>, <a href="socket.TimedOutException.html#_top_">TimedOutException</a>
</pre>
<dl>
  <dd> Wait for a String or a timeout. 
If time runs out, throws a TimedOutException.
Sleeps in intervals of 100 milliseconds until either receiving the
token or timeout.
<P>
More efficient than receiveUntil, but liable to fail on large
tokens that can be spread over several "send"s. In that case,
consider using receiveUntil and ignoring the return value.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> token - String to wait for
    <dd> timeout - time in milliseconds to wait (negative means wait forever)
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> on problems with the socket connection
    <dt> <b>Throws:</b> <a href="socket.TimedOutException.html#_top_">TimedOutException</a>
    <dd> if time runs out before token received
    <dt> <b>See Also:</b>
    <dd> <a href="#receiveUntil(String, long)">receiveUntil</a>
  </dl>
</dl>
<a name="available()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="available"><b>available</b></a>
<pre>
  public int available() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns bytes available to be read.  Since they haven't been
negotiated over, this could be misleading...
</dl>
<a name="receive()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receive"><b>receive</b></a>
<pre>
  public <a href="java.lang.String.html#_top_">String</a> receive() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns a String from the telnet connection. Blocks
until one is available. No guarantees that the string is in
any way complete.
NOTE: uses Java 1.0.2 style String-bytes conversion.
</dl>
<a name="receiveBytes()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receiveBytes"><b>receiveBytes</b></a>
<pre>
  public byte[] receiveBytes() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns a byte array. Blocks until data is available.
</dl>
<a name="receiveUntil(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receiveUntil"><b>receiveUntil</b></a>
<pre>
  public <a href="java.lang.String.html#_top_">String</a> receiveUntil(<a href="java.lang.String.html#_top_">String</a> token) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns all data received up until a certain token.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> token - String to wait for
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> on problems with the socket connection
    <dt> <b>See Also:</b>
    <dd> <a href="#wait">wait</a>
  </dl>
</dl>
<a name="receiveUntil(java.lang.String, long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receiveUntil"><b>receiveUntil</b></a>
<pre>
  public <a href="java.lang.String.html#_top_">String</a> receiveUntil(<a href="java.lang.String.html#_top_">String</a> token,
                             long timeout) throws <a href="java.io.IOException.html#_top_">IOException</a>, <a href="socket.TimedOutException.html#_top_">TimedOutException</a>
</pre>
<dl>
  <dd> Returns all data received up until a certain token.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> token - String to wait for
    <dd> timeout - time in milliseconds to wait (negative means wait forever)
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> on problems with the socket connection
    <dt> <b>Throws:</b> <a href="socket.TimedOutException.html#_top_">TimedOutException</a>
    <dd> if time runs out before token received
    <dt> <b>See Also:</b>
    <dd> <a href="#wait(String, long)">wait</a>
  </dl>
</dl>
<a name="send(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="send"><b>send</b></a>
<pre>
  public void send(<a href="java.lang.String.html#_top_">String</a> s) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Sends a String to the remote host.
NOTE: uses Java 1.0.2 style String-bytes conversion.
  <dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> on problems with the socket connection
  </dl>
</dl>
<a name="sendLine(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="sendLine"><b>sendLine</b></a>
<pre>
  public <a href="java.lang.String.html#_top_">String</a> sendLine(<a href="java.lang.String.html#_top_">String</a> command) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Sends a line to the remote host, returns all data before the prompt.
Since telnet seems to rely on carriage returns ('\r'), 
one will be appended to the sent string, if necessary.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> command - command line to send
    <dt> <b>Returns:</b>
    <dd> whatever data the command produced before the prompt.
    <dt> <b>See Also:</b>
    <dd> <a href="#setPrompt">setPrompt</a>
  </dl>
</dl>
<a name="send(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="send"><b>send</b></a>
<pre>
  public void send(byte buf[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Sends bytes over the telnet connection.
</dl>
<a name="login(java.lang.String, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="login"><b>login</b></a>
<pre>
  public void login(<a href="java.lang.String.html#_top_">String</a> loginName,
                    <a href="java.lang.String.html#_top_">String</a> password) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Logs in as a particular user and password. 
Returns after receiving prompt.
</dl>
<a name="setPrompt(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setPrompt"><b>setPrompt</b></a>
<pre>
  public void setPrompt(<a href="java.lang.String.html#_top_">String</a> prompt)
</pre>
<dl>
  <dd> Sets the expected prompt. 
If this function is not explicitly called, the default prompt is used.
  <dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#setDefaultPrompt">setDefaultPrompt</a>
  </dl>
</dl>
<a name="setDefaultPrompt(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDefaultPrompt"><b>setDefaultPrompt</b></a>
<pre>
  public static void setDefaultPrompt(<a href="java.lang.String.html#_top_">String</a> prompt)
</pre>
<dl>
  <dd> Sets the default prompt used by all TelnetWrappers.
This can be specifically overridden for a specific instance.
The default prompt starts out as "$ " until this function is called.
  <dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#setPrompt">setPrompt</a>
  </dl>
</dl>
<a name="setLogin(java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLogin"><b>setLogin</b></a>
<pre>
  public static void setLogin(<a href="java.lang.String.html#_top_">String</a> login,
                              <a href="java.lang.String.html#_top_">String</a> password)
</pre>
<dl>
  <dd> Sets the default login used by TelnetWrappers.
If this method is called with non-null login and password,
all TelnetWrappers will attempt to login when first created.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> login - login name to use
    <dd> password - password to use
    <dt> <b>See Also:</b>
    <dd> <a href="#login">login</a>, <a href="#unsetLogin">unsetLogin</a>
  </dl>
</dl>
<a name="unsetLogin()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="unsetLogin"><b>unsetLogin</b></a>
<pre>
  public static void unsetLogin()
</pre>
<dl>
  <dd> Turns off the default login of TelnetWrappers.
After this method is called, TelnetWrappers will not
login until that method is explicitly called.
  <dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#setLogin">setLogin</a>, <a href="#login">login</a>
  </dl>
</dl>
<a name="disconnect()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="disconnect"><b>disconnect</b></a>
<pre>
  public void disconnect() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Ends the telnet connection.
</dl>
<a name="finalize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finalize"><b>finalize</b></a>
<pre>
  public void finalize()
</pre>
<dl>
  <dd> Ends the telnet connection.
  <dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#finalize()">finalize</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl>
</dl>
<a name="main(java.lang.String[])"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="main"><b>main</b></a>
<pre>
  public static void main(<a href="java.lang.String.html#_top_">String</a> args[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Telnet test driver.
Modeled after the IOtest.java example in the Telnet Applet.
Logs in to "host", creates a timestamped file in /tmp, lists the
/tmp directory to System.out, disconnects.  Shows off several
TelnetWrapper methods.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> args - host login password prompt
  </dl>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-socket.html">This Package</a>  <a href="socket.TelnetIO.html#_top_">Previous</a>  <a href="Package-socket.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>