Пример #1
0
 public override void Execute(DaemonClient dc, Repository db)
 {
     EndPoint peer = dc.Peer;
     string host = Dns.GetHostEntry((peer as IPEndPoint).Address).HostName ??
                   (peer as IPEndPoint).Address.ToString();
     ReceivePack rp = new ReceivePack(db);
     Stream stream = dc.Stream;
     string name = "anonymous";
     string email = name + "@" + host;
     rp.setRefLogIdent(new PersonIdent(name, email));
     rp.receive(stream, null);
 }
Пример #2
0
            public override void Execute(DaemonClient dc, Repository db)
            {
                EndPoint peer = dc.Peer;

                var ipEndpoint = peer as IPEndPoint;
                if (ipEndpoint == null)
                {
                    throw new InvalidOperationException("peer must be a IPEndPoint");
                }

                string host = Dns.GetHostEntry(ipEndpoint.Address).HostName ?? ipEndpoint.Address.ToString();
                var rp = new ReceivePack(db);
                Stream stream = dc.Stream;
                const string name = "anonymous";
                string email = name + "@" + host;
                rp.setRefLogIdent(new PersonIdent(name, email));
                rp.receive(stream, null);
            }