In a module use carp instead of die.
Use AnyEvent to process the hello packets.