public class UnixSocketChannel extends AbstractNativeSocketChannel
Channel
implementation that uses a native unix
socketgetFD, implCloseSelectableChannel, implConfigureBlocking, read, setFD, shutdownInput, shutdownOutput
open, read, validOps, write
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
register
begin, close, end, isOpen
public static final UnixSocketChannel open() throws IOException
IOException
public static final UnixSocketChannel open(UnixSocketAddress remote) throws IOException
IOException
public static final UnixSocketChannel create() throws IOException
IOException
public static final UnixSocketChannel[] pair() throws IOException
IOException
public static final UnixSocketChannel fromFD(int fd)
fd
- the file descriptor to wrappublic boolean connect(UnixSocketAddress remote) throws IOException
IOException
public boolean isConnected()
isConnected
in class SocketChannel
public boolean isConnectionPending()
isConnectionPending
in class SocketChannel
public boolean finishConnect() throws IOException
finishConnect
in class SocketChannel
IOException
public final UnixSocketAddress getRemoteSocketAddress()
public final UnixSocketAddress getLocalSocketAddress()
public boolean connect(SocketAddress remote) throws IOException
connect
in class SocketChannel
IOException
public UnixSocket socket()
socket
in class SocketChannel
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write
in interface GatheringByteChannel
write
in class AbstractNativeSocketChannel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in class AbstractNativeSocketChannel
IOException
public int write(ByteBuffer src) throws IOException
write
in interface WritableByteChannel
write
in class AbstractNativeSocketChannel
IOException
public SocketAddress getRemoteAddress() throws IOException
getRemoteAddress
in class SocketChannel
IOException
public SocketAddress getLocalAddress() throws IOException
getLocalAddress
in interface NetworkChannel
getLocalAddress
in class SocketChannel
IOException
public final Set<SocketOption<?>> supportedOptions()
public <T> T getOption(SocketOption<T> name) throws IOException
IOException
public <T> SocketChannel setOption(SocketOption<T> name, T value) throws IOException
setOption
in interface NetworkChannel
setOption
in class SocketChannel
IOException
public UnixSocketChannel bind(SocketAddress local) throws IOException
bind
in interface NetworkChannel
bind
in class SocketChannel
IOException
Copyright © 2019. All rights reserved.