public class UnixSocketChannel extends AbstractNativeSocketChannel
Channel implementation that uses a native unix
socket| Modifier and Type | Method and Description |
|---|---|
UnixSocketChannel |
bind(java.net.SocketAddress local) |
boolean |
connect(java.net.SocketAddress remote) |
boolean |
connect(UnixSocketAddress remote) |
static UnixSocketChannel |
create() |
boolean |
finishConnect() |
static UnixSocketChannel |
fromFD(int fd)
Create a UnixSocketChannel to wrap an existing file descriptor
(presumably itself a UNIX socket).
|
java.net.SocketAddress |
getLocalAddress() |
UnixSocketAddress |
getLocalSocketAddress() |
<T> T |
getOption(java.net.SocketOption<T> name) |
java.net.SocketAddress |
getRemoteAddress() |
UnixSocketAddress |
getRemoteSocketAddress() |
boolean |
isConnected() |
boolean |
isConnectionPending() |
static UnixSocketChannel |
open() |
static UnixSocketChannel |
open(UnixSocketAddress remote) |
static UnixSocketChannel[] |
pair() |
int |
read(java.nio.ByteBuffer dst) |
<T> java.nio.channels.SocketChannel |
setOption(java.net.SocketOption<T> name,
T value) |
UnixSocket |
socket() |
java.util.Set<java.net.SocketOption<?>> |
supportedOptions() |
int |
write(java.nio.ByteBuffer src) |
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
getFD, implCloseSelectableChannel, implConfigureBlocking, read, setFD, shutdownInput, shutdownOutputblockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerbegin, close, end, isOpenpublic static final UnixSocketChannel open() throws java.io.IOException
java.io.IOExceptionpublic static final UnixSocketChannel open(UnixSocketAddress remote) throws java.io.IOException
java.io.IOExceptionpublic static final UnixSocketChannel create() throws java.io.IOException
java.io.IOExceptionpublic static final UnixSocketChannel[] pair() throws java.io.IOException
java.io.IOExceptionpublic static final UnixSocketChannel fromFD(int fd)
fd - the file descriptor to wrappublic boolean connect(UnixSocketAddress remote) throws java.io.IOException
java.io.IOExceptionpublic boolean isConnected()
isConnected in class java.nio.channels.SocketChannelpublic boolean isConnectionPending()
isConnectionPending in class java.nio.channels.SocketChannelpublic boolean finishConnect()
throws java.io.IOException
finishConnect in class java.nio.channels.SocketChanneljava.io.IOExceptionpublic final UnixSocketAddress getRemoteSocketAddress()
public final UnixSocketAddress getLocalSocketAddress()
public boolean connect(java.net.SocketAddress remote)
throws java.io.IOException
connect in class java.nio.channels.SocketChanneljava.io.IOExceptionpublic UnixSocket socket()
socket in class java.nio.channels.SocketChannelpublic long write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
throws java.io.IOException
write in interface java.nio.channels.GatheringByteChannelwrite in class AbstractNativeSocketChanneljava.io.IOExceptionpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChannelread in class AbstractNativeSocketChanneljava.io.IOExceptionpublic int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChannelwrite in class AbstractNativeSocketChanneljava.io.IOExceptionpublic java.net.SocketAddress getRemoteAddress()
throws java.io.IOException
getRemoteAddress in class java.nio.channels.SocketChanneljava.io.IOExceptionpublic java.net.SocketAddress getLocalAddress()
throws java.io.IOException
getLocalAddress in interface java.nio.channels.NetworkChannelgetLocalAddress in class java.nio.channels.SocketChanneljava.io.IOExceptionpublic final java.util.Set<java.net.SocketOption<?>> supportedOptions()
public <T> T getOption(java.net.SocketOption<T> name)
throws java.io.IOException
java.io.IOExceptionpublic <T> java.nio.channels.SocketChannel setOption(java.net.SocketOption<T> name,
T value)
throws java.io.IOException
setOption in interface java.nio.channels.NetworkChannelsetOption in class java.nio.channels.SocketChanneljava.io.IOExceptionpublic UnixSocketChannel bind(java.net.SocketAddress local) throws java.io.IOException
bind in interface java.nio.channels.NetworkChannelbind in class java.nio.channels.SocketChanneljava.io.IOExceptionCopyright © 2021. All Rights Reserved.