| GNU Classpath (0.18) | ||
| Prev Class | Next Class | Frames | No Frames | |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr | |
public abstract class SocketChannelextends AbstractSelectableChannelimplements ByteChannel, ScatteringByteChannel, GatheringByteChannelConstructor Summary | |
| |
Method Summary | |
boolean |
|
boolean |
|
boolean |
|
boolean |
|
static SocketChannel |
|
static SocketChannel |
|
int |
|
long |
|
long |
|
Socket |
|
int |
|
int |
|
long |
|
long |
|
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel | |
blockingLock, configureBlocking, implCloseChannel, implCloseSelectableChannel, implConfigureBlocking, isBlocking, isRegistered, keyFor, provider, register | |
Methods inherited from class java.nio.channels.SelectableChannel | |
blockingLock, configureBlocking, isBlocking, isRegistered, keyFor, provider, register, register, validOps | |
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel | |
begin, close, end, implCloseChannel, isOpen | |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | |
public boolean connect(SocketAddress remote) throws IOException
Connects the channel's socket to the remote address.
- Returns:
trueif the channel got successfully connected,falseif the channel is in non-blocking mode and connection operation is still in progress.
- Throws:
AlreadyConnectedException- If this channel is already connected.ConnectionPendingException- If a non-blocking connection operation is already in progress on this channel.IOException- If an error occursSecurityException- If a security manager has been installed and it does not permit access to the given remote endpoint.UnresolvedAddressException- If the given remote address is not fully resolved.UnsupportedAddressTypeException- If the type of the given remote address is not supported.
public boolean finishConnect() throws IOException
Finishes the process of connecting a socket channel.
- Throws:
IOException- If an error occursNoConnectionPendingException- If this channel is not connected and a connection operation has not been initiated.
public boolean isConnectionPending()
Tells whether or not a connection operation is in progress on this channel.
public static SocketChannel open() throws IOException
Opens a socket channel.
- Returns:
- the new
SocketChannelobject
- Throws:
IOException- If an error occurs
public static SocketChannel open(SocketAddress remote) throws IOException
Opens a channel and connects it to a remote address.
- Returns:
- the new
SocketChannelobject
- Throws:
IOException- If an error occursSecurityException- If a security manager has been installed and it does not permit access to the given remote endpoint.UnresolvedAddressException- If the given remote address is not fully resolved.UnsupportedAddressTypeException- If the type of the given remote address is not supported.
public int read(ByteBuffer dst) throws IOException
Reads data from the channel.
- Specified by:
- read in interface ReadableByteChannel
- Returns:
- the number of bytes read, zero is valid too, -1 if end of stream is reached
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
public final long read(ByteBuffer[] dsts) throws IOException
Reads data from the channel.
- Specified by:
- read in interface ScatteringByteChannel
- Returns:
- the number of bytes read, zero is valid too, -1 if end of stream is reached
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException
Reads data from the channel.
- Specified by:
- read in interface ScatteringByteChannel
- Returns:
- the number of bytes read, zero is valid too, -1 if end of stream is reached
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
public final int validOps()
Retrieves the valid operations for this channel.
- Overrides:
- validOps in interface SelectableChannel
- Returns:
- the valid operations
public int write(ByteBuffer src) throws IOException
Writes data to the channel.
- Specified by:
- write in interface WritableByteChannel
- Returns:
- the number of bytes written, zero is valid too
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
public final long write(ByteBuffer[] dsts) throws IOException
Writes data to the channel.
- Specified by:
- write in interface GatheringByteChannel
- Returns:
- the number of bytes written, zero is valid too
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
Writes data to the channel.
- Specified by:
- write in interface GatheringByteChannel
- Returns:
- the number of bytes written, zero is valid too
- Throws:
IOException- If an error occursNotYetConnectedException- If this channel is not yet connected.
| GNU Classpath (0.18) |