Methods Summary |
---|
void | _closeOutputStream()
_output_.close();
|
protected void | _connectAction_()Handles special connection requirements.
super._connectAction_();
InputStream input;
TelnetInputStream tmp;
if (FromNetASCIIInputStream.isConversionRequired())
input = new FromNetASCIIInputStream(_input_);
else
input = _input_;
tmp = new TelnetInputStream(input, this, readerThread);
if(readerThread)
{
tmp._start();
}
// __input CANNOT refer to the TelnetInputStream. We run into
// blocking problems when some classes use TelnetInputStream, so
// we wrap it with a BufferedInputStream which we know is safe.
// This blocking behavior requires further investigation, but right
// now it looks like classes like InputStreamReader are not implemented
// in a safe manner.
__input = new BufferedInputStream(tmp);
__output = new ToNetASCIIOutputStream(new TelnetOutputStream(this));
|
void | _flushOutputStream()
_output_.flush();
|
public void | addOptionHandler(TelnetOptionHandler opthand)Registers a new TelnetOptionHandler for this telnet client to use.
super.addOptionHandler(opthand);
|
public void | deleteOptionHandler(int optcode)Unregisters a TelnetOptionHandler.
super.deleteOptionHandler(optcode);
|
public void | disconnect()Disconnects the telnet session, closing the input and output streams
as well as the socket. If you have references to the
input and output streams of the telnet connection, you should not
close them yourself, but rather call disconnect to properly close
the connection.
__input.close();
__output.close();
super.disconnect();
|
public java.io.InputStream | getInputStream()Returns the telnet connection input stream. You should not close the
stream when you finish with it. Rather, you should call
{@link #disconnect disconnect }.
return __input;
|
public boolean | getLocalOptionState(int option)Returns the state of the option on the local side.
/* BUG (option active when not already acknowledged) (start)*/
return (_stateIsWill(option) && _requestedWill(option));
/* BUG (option active when not already acknowledged) (end)*/
|
public java.io.OutputStream | getOutputStream()Returns the telnet connection output stream. You should not close the
stream when you finish with it. Rather, you should call
{@link #disconnect disconnect }.
return __output;
|
public boolean | getReaderThread()Gets the status of the reader thread.
return (readerThread);
|
public boolean | getRemoteOptionState(int option)Returns the state of the option on the remote side.
/* BUG (option active when not already acknowledged) (start)*/
return (_stateIsDo(option) && _requestedDo(option));
/* BUG (option active when not already acknowledged) (end)*/
|
public void | registerNotifHandler(TelnetNotificationHandler notifhand)Registers a notification handler to which will be sent
notifications of received telnet option negotiation commands.
super.registerNotifHandler(notifhand);
|
public void | registerSpyStream(java.io.OutputStream spystream)Registers an OutputStream for spying what's going on in
the TelnetClient session.
super._registerSpyStream(spystream);
|
public boolean | sendAYT(long timeout)Sends an Are You There sequence and waits for the result.
return (_sendAYT(timeout));
|
public void | setReaderThread(boolean flag)Sets the status of the reader thread.
The reader thread status will apply to all subsequent connections
readerThread = flag;
|
public void | stopSpyStream()Stops spying this TelnetClient.
super._stopSpyStream();
|
public void | unregisterNotifHandler()Unregisters the current notification handler.
super.unregisterNotifHandler();
|