A generic tcp listener process adhering to OTP design principles