API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.nio.channels. SocketChannel View Source
Author(s)
Mark Reinhold
JSR-51 Expert Group
Since
1.4
Version
1.34, 05/11/17
Serial
Hierarchy
 Object
      AbstractInterruptibleChannel
          SelectableChannel
              AbstractSelectableChannel
                  SocketChannel
Implements
 ByteChannel
 ScatteringByteChannel
 GatheringByteChannel
Subclasses
Description
publicabstract abstract class SocketChannel
  A selectable channel for stream-oriented connecting sockets.
See also:   
Constructors
protected SocketChannel (SelectorProvider provider)
Initializes a new instance of this class.
Methods
Hide/Show inherited methods
protectedfinal void begin () [Inherited From AbstractInterruptibleChannel]
  Marks the beginning of an I/O operation that might block indefinitely.
publicfinal Object blockingLock () [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
publicfinal void close () throws IOException [Inherited From AbstractInterruptibleChannel]
  Closes this channel.
publicfinal SelectableChannel configureBlocking (boolean block) throws IOException [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
  Adjusts this channel's blocking mode.
publicabstract boolean connect (SocketAddress remote) throws IOException
  Connects this channel's socket.
protectedfinal void end (boolean completed) throws AsynchronousCloseException [Inherited From AbstractInterruptibleChannel]
  Marks the end of an I/O operation that might block indefinitely.
publicabstract boolean finishConnect () throws IOException
  Finishes the process of connecting a socket channel.
protectedfinal void implCloseChannel () throws IOException [Inherited From AbstractSelectableChannel] [Specified in AbstractInterruptibleChannel]
  Closes this channel.
protectedabstract void implCloseSelectableChannel () throws IOException [Inherited From AbstractSelectableChannel]
  Closes this selectable channel.
protectedabstract void implConfigureBlocking (boolean block) throws IOException [Inherited From AbstractSelectableChannel]
  Adjusts this channel's blocking mode.
publicfinal boolean isBlocking () [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
publicabstract boolean isConnected ()
  Tells whether or not this channel's network socket is connected.
publicabstract boolean isConnectionPending ()
  Tells whether or not a connection operation is in progress on this channel.
publicfinal boolean isOpen () [Inherited From AbstractInterruptibleChannel]
publicfinal boolean isRegistered () [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
publicfinal SelectionKey keyFor (Selector sel) [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
publicstatic SocketChannel open () throws IOException
  Opens a socket channel.
publicstatic SocketChannel open (SocketAddress remote) throws IOException
  Opens a socket channel and connects it to a remote address.
publicfinal SelectorProvider provider () [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
  Returns the provider that created this channel.
publicabstract int read (ByteBuffer dst) throws IOException
 
publicfinal long read (ByteBuffer dsts) throws IOException [Specified in ScatteringByteChannel]
 
publicabstract long read (ByteBuffer dsts, int offset, int length) throws IOException [Specified in ScatteringByteChannel]
 
publicfinal SelectionKey register (Selector sel, int ops) throws ClosedChannelException [Inherited From SelectableChannel]
  Registers this channel with the given selector, returning a selection key.
publicfinal SelectionKey register (Selector sel, int ops, Object att) throws ClosedChannelException [Inherited From AbstractSelectableChannel] [Specified in SelectableChannel]
  Registers this channel with the given selector, returning a selection key.
publicabstract Socket socket ()
  Retrieves a socket associated with this channel.
publicfinal int validOps () [Specified in SelectableChannel]
  Returns an operation set identifying this channel's supported operations.
publicabstract int write (ByteBuffer src) throws IOException
 
publicfinal long write (ByteBuffer srcs) throws IOException [Specified in GatheringByteChannel]
 
publicabstract long write (ByteBuffer srcs, int offset, int length) throws IOException [Specified in GatheringByteChannel]
 
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar