1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net;
17
18 import java.io.OutputStream;
19
20 /***
21 * The DiscardTCPClient class is a TCP implementation of a client for the
22 * Discard protocol described in RFC 863. To use the class, merely
23 * establish a connection with
24 * {@link org.apache.commons.net.SocketClient#connect connect }
25 * and call {@link #getOutputStream getOutputStream() } to
26 * retrieve the discard output stream. Don't close the output stream
27 * when you're done writing to it. Rather, call
28 * {@link org.apache.commons.net.SocketClient#disconnect disconnect }
29 * to clean up properly.
30 * <p>
31 * <p>
32 * @author Daniel F. Savarese
33 * @see DiscardUDPClient
34 ***/
35
36 public class DiscardTCPClient extends SocketClient
37 {
38 /*** The default discard port. It is set to 9 according to RFC 863. ***/
39 public static final int DEFAULT_PORT = 9;
40
41 /***
42 * The default DiscardTCPClient constructor. It merely sets the default
43 * port to <code> DEFAULT_PORT </code>.
44 ***/
45 public DiscardTCPClient ()
46 {
47 setDefaultPort(DEFAULT_PORT);
48 }
49
50 /***
51 * Returns an OutputStream through which you may write data to the server.
52 * You should NOT close the OutputStream when you're finished
53 * reading from it. Rather, you should call
54 * {@link org.apache.commons.net.SocketClient#disconnect disconnect }
55 * to clean up properly.
56 * <p>
57 * @return An OutputStream through which you can write data to the server.
58 ***/
59 public OutputStream getOutputStream()
60 {
61 return _output_;
62 }
63 }