# Method Stdio.UDP()->set_read_callback()

Method set_read_callback

  ``UDP` set_read_callback(`function`(`mapping`(`string`:`int`|`string`), `mixed` ... :`void`) `read_cb`, `mixed` ... `extra_args`)`

Description

  The `read_cb` function will receive a mapping similar to the mapping returned by read():

  ``"data"` : `string`` | Received data.
  ``"ip"` : `string`` | Data was sent from this IP.
  ``"port"` : `int`` | Data was sent from this port.

Returns

  The called object.

See also

  read()