public class NetlinkSocket extends Object implements Closeable
Constructor and Description |
---|
NetlinkSocket(int nlProto) |
Modifier and Type | Method and Description |
---|---|
void |
bind(NetlinkSocketAddress localAddr) |
void |
close()
Closes this stream and releases any system resources associated
with it.
|
void |
connectTo(NetlinkSocketAddress peerAddr) |
void |
connectToKernel() |
NetlinkSocketAddress |
getLocalAddress() |
ByteBuffer |
recvMessage()
Wait indefinitely (or until underlying socket error) for a
netlink message of at most DEFAULT_RECV_BUFSIZE size.
|
ByteBuffer |
recvMessage(int bufsize,
long timeoutMs)
Wait up to |timeoutMs| (or until underlying socket error) for a
netlink message of at most |bufsize| size.
|
ByteBuffer |
recvMessage(long timeoutMs)
Wait up to |timeoutMs| (or until underlying socket error) for a
netlink message of at most DEFAULT_RECV_BUFSIZE size.
|
boolean |
sendMessage(byte[] bytes,
int offset,
int count)
Send a message to a peer to which this socket has previously connected.
|
boolean |
sendMessage(byte[] bytes,
int offset,
int count,
long timeoutMs)
Send a message to a peer to which this socket has previously connected,
waiting at most |timeoutMs| milliseconds for the send to complete.
|
public NetlinkSocket(int nlProto) throws ErrnoException
ErrnoException
public NetlinkSocketAddress getLocalAddress() throws ErrnoException
ErrnoException
public void bind(NetlinkSocketAddress localAddr) throws ErrnoException, SocketException
ErrnoException
SocketException
public void connectTo(NetlinkSocketAddress peerAddr) throws ErrnoException, SocketException
ErrnoException
SocketException
public void connectToKernel() throws ErrnoException, SocketException
ErrnoException
SocketException
public ByteBuffer recvMessage() throws ErrnoException, InterruptedIOException
ErrnoException
InterruptedIOException
public ByteBuffer recvMessage(long timeoutMs) throws ErrnoException, InterruptedIOException
ErrnoException
InterruptedIOException
public ByteBuffer recvMessage(int bufsize, long timeoutMs) throws ErrnoException, IllegalArgumentException, InterruptedIOException
public boolean sendMessage(byte[] bytes, int offset, int count) throws ErrnoException, InterruptedIOException
ErrnoException
InterruptedIOException
public boolean sendMessage(byte[] bytes, int offset, int count, long timeoutMs) throws ErrnoException, IllegalArgumentException, InterruptedIOException
public void close()
Closeable
close
in interface Closeable
close
in interface AutoCloseable