public void Execute(Stream inout) { Stream = inout; string cmd = new PacketLineIn(inout).ReadStringRaw(); if (string.IsNullOrEmpty(cmd)) { return; } int nul = cmd.IndexOf('\0'); if (nul >= 0) { cmd = cmd.Slice(0, nul); } DaemonService srv = Daemon.MatchService(cmd); if (srv == null) { return; } srv.Execute(this, cmd); }
/// <summary> /// Configure a new daemon for the specified network address. /// </summary> /// <param name="addr"> /// Address to listen for connections on. If null, any available /// port will be chosen on all network interfaces. /// </param> public Daemon(IPEndPoint addr) { MyAddress = addr; Exports = new Dictionary <string, Repository>(); ExportBase = new List <DirectoryInfo>(); Processors = new Dictionary <string, Thread>(); Services = new DaemonService[] { new UploadPackService(), new ReceivePackService() }; }
/// <summary> /// Configure a new daemon for the specified network address. /// </summary> /// <param name="addr"> /// Address to listen for connections on. If null, any available /// port will be chosen on all network interfaces. /// </param> public Daemon(IPEndPoint addr) { MyAddress = addr; Exports = new Dictionary<string, Repository>(); ExportBase = new List<DirectoryInfo>(); Processors = new Dictionary<string, Thread>(); Services = new DaemonService[] { new UploadPackService(), new ReceivePackService() }; }