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); }
public void CloseClient(Client client) { lock(_sync) _clients.Remove(client); client.Dispose(); }
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) { } }
public Walker(RegistryProvider registry, Client client, Item rootItem) { _registry = registry; _client = client; _rootItem = rootItem; }