| java.lang.Object org.apache.commons.net.SocketClient org.apache.commons.net.CharGenTCPClient
CharGenTCPClient | final public class CharGenTCPClient extends SocketClient (Code) | | The CharGenTCPClient class is a TCP implementation of a client for the
character generator protocol described in RFC 864. It can also be
used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
(port 15). All of these protocols involve connecting to the appropriate
port, and reading data from an input stream. The chargen protocol
actually sends data until the receiving end closes the connection. All
of the others send only a fixed amount of data and then close the
connection.
To use the CharGenTCPClient class, just establish a
connection with
org.apache.commons.net.SocketClient.connect connect and call
CharGenTCPClient.getInputStream getInputStream() to access
the data. Don't close the input stream when you're done with it. Rather,
call
org.apache.commons.net.SocketClient.disconnect disconnect to clean up properly.
author: Daniel F. Savarese See Also: CharGenUDPClient |
Field Summary | |
final public static int | CHARGEN_PORT The character generator port value of 19 according to RFC 864. | final public static int | DEFAULT_PORT The default chargen port. | final public static int | NETSTAT_PORT The netstat port value of 19. | final public static int | QUOTE_OF_DAY_PORT The quote of the day port value of 17 according to RFC 865. | final public static int | SYSTAT_PORT The systat port value of 11 according to RFC 866. |
Constructor Summary | |
public | CharGenTCPClient() The default constructor for CharGenTCPClient. |
CHARGEN_PORT | final public static int CHARGEN_PORT(Code) | | The character generator port value of 19 according to RFC 864. **
|
DEFAULT_PORT | final public static int DEFAULT_PORT(Code) | | The default chargen port. It is set to 19 according to RFC 864. **
|
NETSTAT_PORT | final public static int NETSTAT_PORT(Code) | | The netstat port value of 19. **
|
QUOTE_OF_DAY_PORT | final public static int QUOTE_OF_DAY_PORT(Code) | | The quote of the day port value of 17 according to RFC 865. **
|
SYSTAT_PORT | final public static int SYSTAT_PORT(Code) | | The systat port value of 11 according to RFC 866. **
|
CharGenTCPClient | public CharGenTCPClient()(Code) | | The default constructor for CharGenTCPClient. It merely sets the
default port to DEFAULT_PORT .
|
getInputStream | public InputStream getInputStream()(Code) | | Returns an InputStream from which the server generated data can be
read. You should NOT close the InputStream when you're finished
reading from it. Rather, you should call
org.apache.commons.net.SocketClient.disconnect disconnect to clean up properly.
An InputStream from which the server generated data can be read. |
Methods inherited from org.apache.commons.net.SocketClient | protected void _connectAction_() throws IOException(Code)(Java Doc) public void connect(InetAddress host, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname) throws SocketException, IOException(Code)(Java Doc) public void disconnect() throws IOException(Code)(Java Doc) public int getDefaultPort()(Code)(Java Doc) public int getDefaultTimeout()(Code)(Java Doc) public InetAddress getLocalAddress()(Code)(Java Doc) public int getLocalPort()(Code)(Java Doc) public InetAddress getRemoteAddress()(Code)(Java Doc) public int getRemotePort()(Code)(Java Doc) public int getSoLinger() throws SocketException(Code)(Java Doc) public int getSoTimeout() throws SocketException(Code)(Java Doc) public boolean getTcpNoDelay() throws SocketException(Code)(Java Doc) public boolean isConnected()(Code)(Java Doc) public void setDefaultPort(int port)(Code)(Java Doc) public void setDefaultTimeout(int timeout)(Code)(Java Doc) public void setSoLinger(boolean on, int val) throws SocketException(Code)(Java Doc) public void setSoTimeout(int timeout) throws SocketException(Code)(Java Doc) public void setSocketFactory(SocketFactory factory)(Code)(Java Doc) public void setTcpNoDelay(boolean on) throws SocketException(Code)(Java Doc) public boolean verifyRemote(Socket socket)(Code)(Java Doc)
|
|
|