예제 #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
            {
            }
        }
예제 #2
0
        public void Write(GlowContainer glow)
        {
            var output = CreateOutput();

            glow.Encode(output);

            output.Finish();
        }
예제 #3
0
파일: Client.cs 프로젝트: jv42/ember-plus
        public void Write(GlowContainer glow)
        {
            var output = CreateOutput();

             glow.Encode(output);

             output.Finish();
        }