Module udp

Types

UdpPacket* = ref object
  data*: string
  source*: tuple[address: IpAddress, port: int]
  dest*: tuple[address: IpAddress, port: int]
  Source Edit
UdpSocket* = ref object of Pipe[UdpPacket]
  handle: ptr uv_udp_t
  inputProvider: Output[UdpPacket]
  outputStream: Input[UdpPacket]
  alreadyBound: bool
  Source Edit

Procs

proc newUdpSocket*(): UdpSocket
  Source Edit
proc send*(self: UdpSocket; dest: tuple[address: IpAddress, port: int]; data: string): Future[
    void]
  Source Edit
proc bindAddress*(socket: UdpSocket; host: IpAddress; port: int): Result[void]
  Source Edit
proc bindAddress*(socket: UdpSocket; host: string; port: int): Future[void] {.
async
.}
  Source Edit