ActiveUdpListener::ActiveUdpListener(Network::ConnectionHandler& parent,
                                     Network::UdpListenerPtr&& listener,
                                     Network::ListenerConfig& config)
    : ConnectionHandlerImpl::ActiveListenerImplBase(parent, config),
      udp_listener_(std::move(listener)), read_filter_(nullptr) {
  // Create the filter chain on creating a new udp listener
  config_.filterChainFactory().createUdpListenerFilterChain(*this, *this);

  // If filter is nullptr, fail the creation of the listener
  if (read_filter_ == nullptr) {
    throw Network::CreateListenerException(
        fmt::format("Cannot create listener as no read filter registered for the udp listener: {} ",
                    config_.name()));
  }
}
ActiveUdpListener::ActiveUdpListener(Network::ConnectionHandler& parent,
                                     Network::UdpListenerPtr&& listener,
                                     Network::ListenerConfig& config)
    : ConnectionHandlerImpl::ActiveListenerImplBase(parent, config),
      udp_listener_(std::move(listener)), read_filter_(nullptr) {
   
  config_.filterChainFactory().createUdpListenerFilterChain(*this, *this);

   
  if (read_filter_ == nullptr) {
    throw Network::CreateListenerException(
        fmt::format("Cannot create listener as no read filter registered for the udp listener: {} ",
                    config_.name()));
  }
}