public class UnixSocketChannel
extends jnr.enxio.channels.NativeSocketChannel
Channel implementation that uses a native unix socket| Modifier and Type | Method and Description |
|---|---|
boolean |
connect(UnixSocketAddress remote) |
boolean |
finishConnect() |
static UnixSocketChannel |
fromFD(int fd)
Create a UnixSocketChannel to wrap an existing file descriptor (presumably itself a UNIX socket).
|
static UnixSocketChannel |
fromFD(int fd,
int ops)
Create a UnixSocketChannel to wrap an existing file descriptor (presumably itself a UNIX socket).
|
Credentials |
getCredentials()
Retrieves the credentials for this UNIX socket.
|
boolean |
getKeepAlive() |
UnixSocketAddress |
getLocalSocketAddress() |
UnixSocketAddress |
getRemoteSocketAddress() |
int |
getSoTimeout() |
boolean |
isConnected() |
boolean |
isConnectionPending() |
static UnixSocketChannel |
open() |
static UnixSocketChannel |
open(UnixSocketAddress remote) |
static UnixSocketChannel[] |
pair() |
void |
setKeepAlive(boolean on) |
void |
setSoTimeout(int timeout) |
getFD, implCloseSelectableChannel, implConfigureBlocking, read, shutdownInput, shutdownOutput, validOps, writeblockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerregisterbegin, close, end, isOpenpublic static final UnixSocketChannel open() throws IOException
IOExceptionpublic static final UnixSocketChannel open(UnixSocketAddress remote) throws IOException
IOExceptionpublic static final UnixSocketChannel[] pair() throws IOException
IOExceptionpublic static final UnixSocketChannel fromFD(int fd)
fd - the file descriptor to wrappublic static final UnixSocketChannel fromFD(int fd, int ops)
fd - the file descriptor to wrapops - the SelectionKey operations the socket supportspublic boolean connect(UnixSocketAddress remote) throws IOException
IOExceptionpublic boolean isConnected()
public boolean isConnectionPending()
public boolean finishConnect()
throws IOException
IOExceptionpublic final UnixSocketAddress getRemoteSocketAddress()
public final UnixSocketAddress getLocalSocketAddress()
public final Credentials getCredentials()
UnsupportedOperationException - if the underlying socket library
doesn't support the SO_PEERCRED optionunix 7; SCM_CREDENTIALSpublic boolean getKeepAlive()
public void setKeepAlive(boolean on)
public int getSoTimeout()
public void setSoTimeout(int timeout)
Copyright © 2016. All Rights Reserved.