Home Contents | # mtd16io.event | Mtd16io | Core4 Lua Event System

## SYNOPSIS

1. msghandle.event = function(msghandle, mtd16)
2. msghandle.eof = function(msghandle [, text, errno])

## DESCRIPTION

The mtd16io.event() callback is called for each message that is received from the attached file descriptor. The received MTD16 encoded message is passed in mtd16.

The mtd16io.eof() callback activates when an end-of-file or error condition exists on the attached file descriptor. End-of-file happens on TCP/IP connections when the connection is closed. In case of an end-of-file, the contents of text and err are both nil. On error, they contain the error text and numeric error code.

## NOTES

Callbacks are called from within event:poll().

## SEE ALSO

mtd16io:clearCallbacks, mtd16io:send