Project

General

Profile

Actions

On UDPREAD » History » Revision 4

« Previous | Revision 4/5 (diff) | Next »
Per Amundsen, 02/10/2016 01:39 PM


Added in 2.3

on <level>:UDPREAD:name:<commands>

Triggers when there is info waiting to be read on the specified UDP connection.
You can read this info using the /sockread command.

See also on SOCKREAD, on SOCKOPEN, on SOCKCLOSE, on SOCKLISTEN, on SOCKWRITE, /sockudp, $sock, $sockbr, $sockerr, $sockname.

Parameters

<level> - The level for the event to trigger.
<name> - The UDP $sockname to listen to.
<commands> - The commands to be performed when the event listener's criteria is met.

Example

on *:udpread:name:{
  if ($sockerr) { echo -s An error occurred while trying to read data: $sock($sockname).wsmsg | return }
  else {
    sockread %a
    echo -s received: %a
  }
}

Updated by Per Amundsen almost 9 years ago · 4 revisions

Also available in: PDF HTML TXT