com.sas.net.connect
Interface TelnetClientInterface

All Known Implementing Classes:
SASTelnetClient

public interface TelnetClientInterface

interface that must be supported by a Telnet client if it is to be used by com.sas.net.connect.TelnetConnectClient.

See Also:
TelnetConnectClient

Method Summary
 void connect(java.lang.String host, int port)
          connect to the telnet daemon.
 void disconnect()
          disconnect from the telnet daemon.
 com.sas.net.crypto.CipherInterface getCipher()
          get the cipher object used by the telnet client.
 java.net.Socket getSocket()
          get the socket used by the telnet client.
 boolean isSocketInherited()
          true if the ConnectClient should inherit the socket used for the telnet connection.
 char receiveChar(int tioTimeout)
          receive data from the remote telnet session.
 void sendString(java.lang.String data)
          send data to the remote telnet session.
 

Method Detail

connect

void connect(java.lang.String host,
             int port)
             throws TelnetClientException
connect to the telnet daemon.

Parameters:
host - host machine's IP name
port - TCP port number
Throws:
TelnetClientException - if there is an IO error

disconnect

void disconnect()
                throws TelnetClientException
disconnect from the telnet daemon.

Throws:
TelnetClientException - if there is an IO error

receiveChar

char receiveChar(int tioTimeout)
                 throws TelnetClientException
receive data from the remote telnet session.

Parameters:
tioTimeout - number of milliseconds to wait for a character to arrive before throwing an exception. 0 means wait indefinitely.
Returns:
a character received from remote telnet session
Throws:
TelnetClientException - if there is an IO error or if a character does not arrive in the allowed time.

sendString

void sendString(java.lang.String data)
                throws TelnetClientException
send data to the remote telnet session.

Parameters:
data - the string to send
Throws:
TelnetClientException - if there is an IO error

isSocketInherited

boolean isSocketInherited()
true if the ConnectClient should inherit the socket used for the telnet connection. This method always returns false if called before connect or after disconnect.

Returns:
true if the ConnectClient should inherit the socket used for the telnet connection

getSocket

java.net.Socket getSocket()
get the socket used by the telnet client. This method returns null if called before connect or after disconnect.

Returns:
get the socket used by the telnet client

getCipher

com.sas.net.crypto.CipherInterface getCipher()
get the cipher object used by the telnet client. This method returns null if called before connect or after disconnect.

Returns:
get the cipher object used by the telnet client



Copyright © 2009 SAS Institute Inc. All Rights Reserved.