Exemple #1
0
        public SendHandler()
        {
            MultithreadEventLoopGroup eventLoopGroup = new MultithreadEventLoopGroup();

            for (; ;)
            {
                try
                {
                    ConcurrentDictionary <string, ISocketChannel> map = GatewayService.getChannels();
                    foreach (string s in map.Keys)
                    {
                        var writer = new RunWriter {
                            channel = map[s]
                        };

                        eventLoopGroup.Execute(writer);/*.WriteAndFlushAsync(Unpooled.WrappedBuffer(Encoding.UTF8.GetBytes("Hello world")));*/
                    }
                    Thread.Sleep(5000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }