monix.nio.udp

Type members

Classlikes

abstract class AsyncDatagramChannel extends AutoCloseable

An asynchronous channel for reading, writing, and manipulating an UDP socket.

An asynchronous channel for reading, writing, and manipulating an UDP socket.

On the JVM this is a wrapper around java.nio.channels.DatagramChannel

Companion
object
Companion
class
case class Packet(data: Array[Byte], to: InetSocketAddress)
abstract class TaskDatagramChannel

A Task based asynchronous channel for reading, writing, and manipulating an UDP socket.

A Task based asynchronous channel for reading, writing, and manipulating an UDP socket.

On the JVM this is a wrapper around java.nio.channels.DatagramChannel

Example
 val ch = TaskDatagramChannel()
 ch
   .send(Packet("Hello world!".getBytes("UTF-8")), new InetSocketAddress("localhost", 2115)))
   .map { len =>
     println(len)
     ch.close()
   }
   .runAsync
Companion
object
Companion
class

Value members

Concrete methods

def bind(host: String, port: Int)(implicit scheduler: Scheduler): Task[TaskDatagramChannel]

Opens a TaskDatagramChannel which can receive packets on the specified UDP port.

Opens a TaskDatagramChannel which can receive packets on the specified UDP port.

Value Params
host

hostname

port

UDP port number

Returns

a TaskDatagramChannel