//adds a site to listen for
 public void AttachSite(Site site,sIPPortPair ipp)
 {
     if (UseSSL || ipp.UseSSL)
         new BoundMultipleSSLException(new sIPPortPair(_ip, _port, false));
     if ((ipp.Address == IPAddress.Any)||((IP!=IPAddress.Any)&&(ipp.Address!=_ip)))
         _ip = IPAddress.Any;
     _sites.Add(site);
 }
 public override X509Certificate GetCertificateForEndpoint(sIPPortPair pair)
 {
     if (SSLCertificatePath == null)
         return null;
     return X509Certificate.CreateFromCertFile(SSLCertificatePath);
 }
 public BoundMultipleSSLException(sIPPortPair pair) :
     base("An attempt was made to bind multiple sites to "+pair.Address.ToString()+":"+pair.Port.ToString()+" and request using ssl, unable to handle.")
 {
 }
 //creates a new instance of a tcp port listener for a given site
 public PortListener(Site site,sIPPortPair ipp)
 {
     _rand = new MT19937(DateTime.Now.Ticks);
     _sites = new List<Site>();
     _sites.Add(site);
     _port = ipp.Port;
     _ip = ipp.Address;
     _useSSL = ipp.UseSSL;
     _idleSeonds = (long)Math.Min(_idleSeonds, ipp.IdleSeconds);
     _totalRunSeconds = (long)Math.Min(_totalRunSeconds, ipp.TotalRunSeconds);
     _backLog = (int)Math.Min(_backLog, ipp.BackLog);
 }
 public override X509Certificate GetCertificateForEndpoint(sIPPortPair pair)
 {
     return new X509Certificate(".\\testCert.cer");
 }
 public virtual X509Certificate GetCertificateForEndpoint(sIPPortPair pair)
 {
     throw new NotImplementedException();
 }