destroy method

void destroy()

Cleans up event listeners.

Implementation

void destroy() {
  conn.off('data', ondata);
  conn.off('error', onError);
  conn.off('close', onClose);
  decoder.off('decoded', ondecoded);
}