io handler task

longer but more explicit: only one message is handled at a time