public class UnixSocketChannel extends AbstractNativeSocketChannel
Channel
implementation that uses a native unix
socketModifier 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, shutdownOutput
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
begin, close, end, isOpen
public static final UnixSocketChannel open() throws java.io.IOException
java.io.IOException
public static final UnixSocketChannel open(UnixSocketAddress remote) throws java.io.IOException
java.io.IOException
public static final UnixSocketChannel create() throws java.io.IOException
java.io.IOException
public static final UnixSocketChannel[] pair() throws java.io.IOException
java.io.IOException
public static final UnixSocketChannel fromFD(int fd)
fd
- the file descriptor to wrappublic boolean connect(UnixSocketAddress remote) throws java.io.IOException
java.io.IOException
public boolean isConnected()
isConnected
in class java.nio.channels.SocketChannel
public boolean isConnectionPending()
isConnectionPending
in class java.nio.channels.SocketChannel
public boolean finishConnect() throws java.io.IOException
finishConnect
in class java.nio.channels.SocketChannel
java.io.IOException
public final UnixSocketAddress getRemoteSocketAddress()
public final UnixSocketAddress getLocalSocketAddress()
public boolean connect(java.net.SocketAddress remote) throws java.io.IOException
connect
in class java.nio.channels.SocketChannel
java.io.IOException
public UnixSocket socket()
socket
in class java.nio.channels.SocketChannel
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
write
in interface java.nio.channels.GatheringByteChannel
write
in class AbstractNativeSocketChannel
java.io.IOException
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
read
in class AbstractNativeSocketChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.WritableByteChannel
write
in class AbstractNativeSocketChannel
java.io.IOException
public java.net.SocketAddress getRemoteAddress() throws java.io.IOException
getRemoteAddress
in class java.nio.channels.SocketChannel
java.io.IOException
public java.net.SocketAddress getLocalAddress() throws java.io.IOException
getLocalAddress
in interface java.nio.channels.NetworkChannel
getLocalAddress
in class java.nio.channels.SocketChannel
java.io.IOException
public final java.util.Set<java.net.SocketOption<?>> supportedOptions()
public <T> T getOption(java.net.SocketOption<T> name) throws java.io.IOException
java.io.IOException
public <T> java.nio.channels.SocketChannel setOption(java.net.SocketOption<T> name, T value) throws java.io.IOException
setOption
in interface java.nio.channels.NetworkChannel
setOption
in class java.nio.channels.SocketChannel
java.io.IOException
public UnixSocketChannel bind(java.net.SocketAddress local) throws java.io.IOException
bind
in interface java.nio.channels.NetworkChannel
bind
in class java.nio.channels.SocketChannel
java.io.IOException
Copyright © 2023. All Rights Reserved.