public async Task StartAsync <TChannelHandler>(TChannelHandler channelHandler, Action <IChannel> configureProcess) where TChannelHandler : IChannelHandler { IEventLoopGroup group = null; try { var channel = await WrapperFactory .CreateUdp(out group) .Configure(bootstrap => { bootstrap .Option(ChannelOption.SoBroadcast, true) .Handler(new LoggingHandler("SRV-LSTN")); }) .AddQuoteOfTheMomentHandler(channelHandler) .BindAsync(_serverOptions.Port).ConfigureAwait(); configureProcess.Invoke(channel); } catch (Exception ex) { Logger.LogError(ex, ex.AsInnerMessage()); } finally { await group.ShutdownGracefullyAsync(_serverOptions.QuietPeriod, _serverOptions.TimeOut).ConfigureAwait(); } }