| Modifier and Type | Field and Description |
|---|---|
| private final UnixDatagramChannel | |
| private final AtomicBoolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | bind(final SocketAddress
The local)UnixSocketAddress to bind to.Overrides java. |
| public synchronized void | close()
Overrides java. Implements java. |
| public void | connect(SocketAddress
The remote address. addr)Overrides java. |
| public void | connect(InetAddress
the remote address for the socket addr, int the remote port for the socket. port)Overrides java. |
| public synchronized void | |
| public DatagramChannel | getChannel()
Overrides java. java. object
associated with this datagram socket, if any.
|
| public final Credentials | Returns: the credentials of the remote; null if not connectedRetrieves the credentials for this UNIX socket. |
| public InetAddress | Returns: null always.Overrides java. |
| public SocketAddress | Returns: aSocketAddress representing the local endpoint of this
socket, or null if it is closed or not bound.
A non-null return value is always of type UnixSocketAddress |
| public int | getReceiveBufferSize()
Overrides java. DatagramSocket, that is the
buffer size, in bytes, used by the platform for input on this DatagramSocket.
|
| public SocketAddress | Returns: aSocketAddress representing the remote
endpoint of this socket, or null if it is
not connected.
A non-null return value is always of type UnixSocketAddressOverrides java. null if it is unconnected.
|
| public int | getSendBufferSize()
Overrides java. DatagramSocket, that is the
buffer size, in bytes, used by the platform for output on this DatagramSocket.
|
| public int | |
| private void | |
| public boolean | |
| public boolean | |
| public boolean | isConnected()
Overrides java. |
| public synchronized void | receive(DatagramPacket
the p)DatagramPacket into which to place
the incoming data.Overrides java. |
| public void | send(DatagramPacket
the p)DatagramPacket to be sent.Overrides java. |
| public void | setReceiveBufferSize(int
the size to which to set the receive buffer
size, in bytes. This value must be greater than 0. size)Overrides java. DatagramSocket.
|
| public void | setSendBufferSize(int
the size to which to set the send buffer
size, in bytes. This value must be greater than 0. size)Overrides java. DatagramSocket.
|
| public void | setSoTimeout(int
the specified timeout in milliseconds. timeout)Overrides java. |
| chan | back to summary |
|---|---|
| private final UnixDatagramChannel chan | |
| closed | back to summary |
|---|---|
| private final AtomicBoolean closed | |
| UnixDatagramSocket | back to summary |
|---|---|
| pack-priv UnixDatagramSocket(final UnixDatagramChannel channel) throws SocketException Constructs a new instance.
| |
| UnixDatagramSocket | back to summary |
|---|---|
| public UnixDatagramSocket() throws SocketException Constructs a new unbound instance.
| |
| bind | back to summary |
|---|---|
| public void bind(final SocketAddress local) throws SocketException Overrides java. Binds this UnixDatagramSocket to a specific AF_UNIX address.
If the address is
| |
| close | back to summary |
|---|---|
| public synchronized void close() Overrides java. Implements java. Doc from java. Closes this datagram socket.
Any thread currently blocked in If this socket has an associated channel then the channel is closed as well.
| |
| connect | back to summary |
|---|---|
| public void connect(SocketAddress addr) throws SocketException Overrides java. Doc from java. Connects this socket to a remote socket address (IP address + port number). If given an
| |
| connect | back to summary |
|---|---|
| public void connect(InetAddress addr, int port) Overrides java. Doc from java. Connects the socket to a remote address for this socket. When a socket is connected to a remote address, packets may only be sent to or received from that address. By default a datagram socket is not connected. If the socket is already closed, then this method has no effect. If this socket is not bound then this method will first cause the
socket to be bound to an address that is assigned automatically,
as if invoking the If a security manager has been installed then it is invoked to check
access to the remote address. Specifically, if the given Care should be taken to ensure that a connected datagram socket
is not shared with untrusted code. When a socket is connected,
| |
| disconnect | back to summary |
|---|---|
| public synchronized void disconnect() Overrides java. Doc from java. Disconnects the socket. If the socket is closed or not connected, then this method has no effect.
| |
| getChannel | back to summary |
|---|---|
| public DatagramChannel getChannel() Overrides java. Doc from java. Returns the unique A datagram socket will have a channel if, and only if, the channel
itself was created via the
| |
| getCredentials | back to summary |
|---|---|
| public final Credentials getCredentials() throws SocketException Retrieves the credentials for this UNIX socket. Clients calling this method will receive the server's credentials, and servers will receive the client's credentials. User ID, group ID, and PID are supplied. See man unix 7; SCM_CREDENTIALS
| |
| getInetAddress | back to summary |
|---|---|
| public InetAddress getInetAddress() Overrides java. Returns the address to which this socket is connected (NOT implemented).
Since AF_UNIX sockets can not have an InetAddress, this returns always
| |
| getLocalSocketAddress | back to summary |
|---|---|
| public SocketAddress getLocalSocketAddress() Overrides java. Returns the address of the endpoint this socket is bound to.
| |
| getReceiveBufferSize | back to summary |
|---|---|
| public int getReceiveBufferSize() throws SocketException Overrides java. Doc from java. Get value of the SO_RCVBUF option for this
| |
| getRemoteSocketAddress | back to summary |
|---|---|
| public SocketAddress getRemoteSocketAddress() Overrides java. Returns the address of the endpoint this socket is connected to, or
| |
| getSendBufferSize | back to summary |
|---|---|
| public int getSendBufferSize() throws SocketException Overrides java. Doc from java. Get value of the SO_SNDBUF option for this
| |
| getSoTimeout | back to summary |
|---|---|
| public int getSoTimeout() throws SocketException Overrides java. Doc from java. Retrieve setting for SO_TIMEOUT. 0 returns implies that the option is disabled (i.e., timeout of infinity).
| |
| ignore | back to summary |
|---|---|
| private void ignore() | |
| isBound | back to summary |
|---|---|
| public boolean isBound() Overrides java. Doc from java. Returns the binding state of the socket.
If the socket was bound prior to being
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Overrides java. Doc from java. Returns whether the socket is closed or not.
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() Overrides java. Doc from java. Returns the connection state of the socket.
If the socket was connected prior to being
| |
| receive | back to summary |
|---|---|
| public synchronized void receive(DatagramPacket p) throws IOException Overrides java. Receives a datagram packet from this socket (NOT implemented).
Unfortunately,
| |
| send | back to summary |
|---|---|
| public void send(DatagramPacket p) throws IOException Overrides java. Sends a datagram packet from this socket (NOT implemented).
Unfortunately,
| |
| setReceiveBufferSize | back to summary |
|---|---|
| public void setReceiveBufferSize(int size) throws SocketException Overrides java. Doc from java. Sets the SO_RCVBUF option to the specified value for this
Because SO_RCVBUF is a hint, applications that want to
verify what size the buffers were set to should call
Increasing SO_RCVBUF may allow the network implementation
to buffer multiple packets when packets arrive faster than
are being received using Note It is implementation specific if a packet larger than SO_RCVBUF can be received.
| |
| setSendBufferSize | back to summary |
|---|---|
| public void setSendBufferSize(int size) throws SocketException Overrides java. Doc from java. Sets the SO_SNDBUF option to the specified value for this
As SO_SNDBUF is a hint, applications that want to verify
what size the buffer is should call Increasing the buffer size may allow multiple outgoing packets to be queued by the network implementation when the send rate is high. Note If
| |
| setSoTimeout | back to summary |
|---|---|
| public void setSoTimeout(int timeout) throws SocketException Overrides java. Doc from java. Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a positive timeout value, a call to receive() for this DatagramSocket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the DatagramSocket is still valid. A timeout of zero is interpreted as an infinite timeout. The option must be enabled prior to entering the blocking operation to have effect.
| |