Exemple #1
0
        void AcceptCallback(IAsyncResult result)
        {
            var listener = (TcpListener)result.AsyncState;

            try
            {
                var socket = listener.EndAcceptSocket(result);
                var client = new Client(socket, this);

                lock (_sync)
                    _clients.Add(client);

                if (_glow != null)
                {
                    var glowOutPut = new GlowOutput(0, (_, e) => socket.Send(e.FramedPackage));

                    using (glowOutPut)
                    {
                        _glow.Encode(glowOutPut);

                        glowOutPut.Finish();
                    }
                }

                listener.BeginAcceptSocket(AcceptCallback, listener);
            }
            catch
            {
            }
        }
Exemple #2
0
        public void Write(GlowContainer glow)
        {
            var output = CreateOutput();

            glow.Encode(output);

            output.Finish();
        }
Exemple #3
0
        public void Write(GlowContainer glow)
        {
            var output = CreateOutput();

             glow.Encode(output);

             output.Finish();
        }