/[classpath]/classpath/java/nio/channels/SocketChannel.java
ViewVC logotype

Diff of /classpath/java/nio/channels/SocketChannel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by mkoch, Thu Apr 8 20:59:20 2004 UTC revision 1.12 by mkoch, Sun Nov 21 20:23:33 2004 UTC
# Line 1  Line 1 
1  /* SocketChannel.java --  /* SocketChannel.java --
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002, 2004  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package java.nio.channels;  package java.nio.channels;
40    
41  import java.io.IOException;  import java.io.IOException;
# Line 44  import java.nio.ByteBuffer; Line 45  import java.nio.ByteBuffer;
45  import java.nio.channels.spi.AbstractSelectableChannel;  import java.nio.channels.spi.AbstractSelectableChannel;
46  import java.nio.channels.spi.SelectorProvider;  import java.nio.channels.spi.SelectorProvider;
47    
   
48  /**  /**
49   * @author Michael Koch   * @author Michael Koch (konqueror@gmx.de)
50   * @since 1.4   * @since 1.4
51   */   */
52  public abstract class SocketChannel extends AbstractSelectableChannel  public abstract class SocketChannel extends AbstractSelectableChannel
53    implements ByteChannel, ScatteringByteChannel, GatheringByteChannel    implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
54  {  {
55    /**    /**
56     * Initializes this socket.     * Initializes this socket channel.
57     */     */
58    protected SocketChannel(SelectorProvider provider)    protected SocketChannel(SelectorProvider provider)
59    {    {
# Line 63  public abstract class SocketChannel exte Line 63  public abstract class SocketChannel exte
63    /**    /**
64     * Opens a socket channel.     * Opens a socket channel.
65     *     *
66       * @return the new <code>SocketChannel</code> object
67       *
68     * @exception IOException If an error occurs     * @exception IOException If an error occurs
69     */     */
70    public static SocketChannel open() throws IOException    public static SocketChannel open() throws IOException
# Line 73  public abstract class SocketChannel exte Line 75  public abstract class SocketChannel exte
75    /**    /**
76     * Opens a channel and connects it to a remote address.     * Opens a channel and connects it to a remote address.
77     *     *
78       * @return the new <code>SocketChannel</code> object
79       *
80     * @exception AsynchronousCloseException If this channel is already connected.     * @exception AsynchronousCloseException If this channel is already connected.
81     * @exception ClosedByInterruptException If another thread interrupts the     * @exception ClosedByInterruptException If another thread interrupts the
82     * current thread while the connect operation is in progress, thereby closing     * current thread while the connect operation is in progress, thereby closing
# Line 96  public abstract class SocketChannel exte Line 100  public abstract class SocketChannel exte
100    /**    /**
101     * Reads data from the channel.     * Reads data from the channel.
102     *     *
103       * @return the number of bytes read, zero is valid too, -1 if end of stream
104       * is reached
105       *
106     * @exception IOException If an error occurs     * @exception IOException If an error occurs
107     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
108     */     */
# Line 112  public abstract class SocketChannel exte Line 119  public abstract class SocketChannel exte
119    /**    /**
120     * Writes data to the channel.     * Writes data to the channel.
121     *     *
122       * @return the number of bytes written, zero is valid too
123       *
124     * @exception IOException If an error occurs     * @exception IOException If an error occurs
125     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
126     */     */
# Line 127  public abstract class SocketChannel exte Line 136  public abstract class SocketChannel exte
136    
137    /**    /**
138     * Retrieves the valid operations for this channel.     * Retrieves the valid operations for this channel.
139       *
140       * @return the valid operations
141     */     */
142    public final int validOps()    public final int validOps()
143    {    {
# Line 137  public abstract class SocketChannel exte Line 148  public abstract class SocketChannel exte
148    /**    /**
149     * Reads data from the channel.     * Reads data from the channel.
150     *     *
151       * @return the number of bytes read, zero is valid too, -1 if end of stream
152       * is reached
153       *
154     * @exception IOException If an error occurs     * @exception IOException If an error occurs
155     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
156     */     */
# Line 145  public abstract class SocketChannel exte Line 159  public abstract class SocketChannel exte
159    /**    /**
160     * Connects the channel's socket to the remote address.     * Connects the channel's socket to the remote address.
161     *     *
162       * @return <code>true</code> if the channel got successfully connected,
163       * <code>false</code> if the channel is in non-blocking mode and connection
164       * operation is still in progress.
165       *
166     * @exception AlreadyConnectedException If this channel is already connected.     * @exception AlreadyConnectedException If this channel is already connected.
167     * @exception AsynchronousCloseException If this channel is already connected.     * @exception AsynchronousCloseException If this channel is already connected.
168     * @exception ClosedByInterruptException If another thread interrupts the     * @exception ClosedByInterruptException If another thread interrupts the
# Line 191  public abstract class SocketChannel exte Line 209  public abstract class SocketChannel exte
209    /**    /**
210     * Reads data from the channel.     * Reads data from the channel.
211     *     *
212       * @return the number of bytes read, zero is valid too, -1 if end of stream
213       * is reached
214       *
215     * @exception IOException If an error occurs     * @exception IOException If an error occurs
216     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
217     */     */
# Line 199  public abstract class SocketChannel exte Line 220  public abstract class SocketChannel exte
220    
221    /**    /**
222     * Retrieves the channel's socket.     * Retrieves the channel's socket.
223       *
224       * @return the socket
225     */     */
226    public abstract Socket socket();    public abstract Socket socket();
227    
228    /**    /**
229     * Writes data to the channel.     * Writes data to the channel.
230     *     *
231       * @return the number of bytes written, zero is valid too
232       *
233     * @exception IOException If an error occurs     * @exception IOException If an error occurs
234     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
235     */     */
# Line 213  public abstract class SocketChannel exte Line 238  public abstract class SocketChannel exte
238    /**    /**
239     * Writes data to the channel.     * Writes data to the channel.
240     *     *
241       * @return the number of bytes written, zero is valid too
242       *
243     * @exception IOException If an error occurs     * @exception IOException If an error occurs
244     * @exception NotYetConnectedException If this channel is not yet connected.     * @exception NotYetConnectedException If this channel is not yet connected.
245     */     */

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26