예제 #1
0
        public void ReadGlow(GlowContainer glow, Client client)
        {
            var rootItem = new Item(null, _rootKey.Name, false, _rootKey);

             var walker = new Walker(this, client, rootItem);
             walker.Walk(glow);
        }
예제 #2
0
        public void CloseClient(Client client)
        {
            lock(_sync)
            _clients.Remove(client);

             client.Dispose();
        }
예제 #3
0
        void Callback_Accept(IAsyncResult result)
        {
            var listener = (TcpListener)result.AsyncState;

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

            lock(_sync)
               _clients.Add(client);

            listener.BeginAcceptSocket(Callback_Accept, listener);
            socket.BeginReceive(_buffer, 0, _buffer.Length, SocketFlags.None, Callback_Receive, client);
             }
             catch(SocketException ex)
             {
            Console.WriteLine("Accept error: {0}", ex);
             }
             catch(ObjectDisposedException)
             {
             }
        }
예제 #4
0
 public Walker(RegistryProvider registry, Client client, Item rootItem)
 {
     _registry = registry;
     _client = client;
     _rootItem = rootItem;
 }