final class DatagramChannel extends GatheringByteChannel with ScatteringByteChannel
A java.nio.channels.DatagramChannel wrapper allowing for idiomatic zio.ZIO interoperability.
- Alphabetic
- By Inheritance
- DatagramChannel
- ScatteringByteChannel
- GatheringByteChannel
- Channel
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
channel: java.nio.channels.DatagramChannel
- Attributes
- protected[channels]
- Definition Classes
- DatagramChannel → ScatteringByteChannel → GatheringByteChannel → Channel
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
disconnect: IO[IOException, DatagramChannel]
Disconnects this channel's underlying socket.
Disconnects this channel's underlying socket.
- returns
the disconnected datagram channel
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isConnected: UIO[Boolean]
Tells whether this channel's underlying socket is both open and connected.
Tells whether this channel's underlying socket is both open and connected.
- returns
truewhen the socket is both open and connected, otherwisefalse
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isOpen: UIO[Boolean]
Tells whether or not this channel is open.
Tells whether or not this channel is open.
- Definition Classes
- Channel
-
def
localAddress: IO[IOException, Option[SocketAddress]]
Optionally returns the socket address that this channel's underlying socket is bound to.
Optionally returns the socket address that this channel's underlying socket is bound to.
- returns
the local address if the socket is bound, otherwise
None
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
read(dst: ByteBuffer): IO[IOException, Int]
Reads a datagram into the given zio.nio.core.ByteBuffer.
Reads a datagram into the given zio.nio.core.ByteBuffer. This effect can only succeed if the channel is connected, and it only accepts datagrams from the connected remote address.
- dst
the destination buffer
- returns
the number of bytes that were read from this channel
-
final
def
read(capacity: Int): IO[Exception, Chunk[Byte]]
- Definition Classes
- ScatteringByteChannel
-
final
def
readBuffer(dst: Buffer[Byte]): IO[Exception, Option[Long]]
- Definition Classes
- ScatteringByteChannel
-
final
def
readBuffer(dsts: List[Buffer[Byte]]): IO[Exception, Option[Long]]
- Definition Classes
- ScatteringByteChannel
-
def
receive(dst: ByteBuffer): IO[IOException, Option[SocketAddress]]
Receives a datagram via this channel into the given zio.nio.core.ByteBuffer.
Receives a datagram via this channel into the given zio.nio.core.ByteBuffer.
- dst
the destination buffer
- returns
the socket address of the datagram's source, if available.
-
def
remoteAddress: IO[IOException, Option[SocketAddress]]
Optionally returns the remote socket address that this channel's underlying socket is connected to.
Optionally returns the remote socket address that this channel's underlying socket is connected to.
- returns
the remote address if the socket is connected, otherwise
None
-
def
send(src: ByteBuffer, target: SocketAddress): IO[IOException, Int]
Sends a datagram via this channel to the given target zio.nio.core.SocketAddress.
Sends a datagram via this channel to the given target zio.nio.core.SocketAddress.
- src
the source buffer
- target
the target address
- returns
the number of bytes that were sent over this channel
-
def
setOption[T](name: SocketOption[T], value: T): IO[IOException, DatagramChannel]
Sets the value of the given socket option.
Sets the value of the given socket option.
- name
the socket option to be set
- value
the value to be set
- returns
the datagram channel with the given socket option set to the provided value
-
def
socket: UIO[DatagramSocket]
Returns a reference to this channel's underlying datagram socket.
Returns a reference to this channel's underlying datagram socket.
- returns
the underlying datagram socket
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
validOps: UIO[Int]
Returns the set of operations supported by this channel.
Returns the set of operations supported by this channel.
- returns
the set of valid operations
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write(src: ByteBuffer): IO[IOException, Int]
Writes a datagram read from the given zio.nio.core.ByteBuffer.
Writes a datagram read from the given zio.nio.core.ByteBuffer. This effect can only succeed if the channel is connected, and it only sends datagrams to the connected remote address.
- src
the source buffer from which the datagram is to be read
- returns
the number of bytes that were written to this channel
-
final
def
write(src: Chunk[Byte]): IO[Exception, Long]
- Definition Classes
- GatheringByteChannel
-
final
def
write(srcs: List[Chunk[Byte]]): IO[Exception, Long]
- Definition Classes
- GatheringByteChannel
-
final
def
writeBuffer(src: Buffer[Byte]): IO[Exception, Long]
- Definition Classes
- GatheringByteChannel
-
final
def
writeBuffer(srcs: List[Buffer[Byte]]): IO[Exception, Long]
- Definition Classes
- GatheringByteChannel