Beispiel #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);
        }
Beispiel #2
0
        public void CloseClient(Client client)
        {
            lock(_sync)
            _clients.Remove(client);

             client.Dispose();
        }
Beispiel #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)
             {
             }
        }
Beispiel #4
0
 public Walker(RegistryProvider registry, Client client, Item rootItem)
 {
     _registry = registry;
     _client = client;
     _rootItem = rootItem;
 }