public void NL_Clear() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; coll.Clear(); }
public void NL_AddBadUri() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; coll.Add("httpblah://127.0.0.1:8181/"); }
public void NL_RemoveBadUri() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; Assert.IsFalse(coll.Remove("httpblah://127.0.0.1:8181/")); }
ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue; public HttpListener() { prefixes = new HttpListenerPrefixCollection(this); registry = new Hashtable(); ctx_queue = new ArrayList(); wait_queue = new ArrayList(); auth_schemes = AuthenticationSchemes.Anonymous; }
public void Disposed3() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Close(); coll.Clear(); }
public HttpListener() { prefixes = new HttpListenerPrefixCollection(this); registry = new Dictionary <HttpListenerContext, HttpListenerContext> (); ctx_queue = new List <HttpListenerContext> (); wait_queue = new List <ListenerAsyncResult> (); auth_schemes = AuthenticationSchemes.Anonymous; }
public void Disposed4() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Close(); coll.Remove("http://localhost:7777/hola/"); }
public void NL_DefaultProperties() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; Assert.AreEqual(0, coll.Count, "Count"); Assert.IsFalse(coll.IsReadOnly, "IsReadOnly"); Assert.IsFalse(coll.IsSynchronized, "IsSynchronized"); }
public void Disposed5() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Close(); string [] strs = new string [0]; coll.CopyTo(strs, 0); }
public void DefaultProperties() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; coll.Add("http://127.0.0.1:8181/"); Assert.AreEqual(1, coll.Count, "Count"); Assert.IsFalse(coll.IsReadOnly, "IsReadOnly"); Assert.IsFalse(coll.IsSynchronized, "IsSynchronized"); }
public void Disposed1() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Close(); Assert.AreEqual(0, coll.Count, "Count"); Assert.IsFalse(coll.IsReadOnly, "IsReadOnly"); Assert.IsFalse(coll.IsSynchronized, "IsSynchronized"); }
public HttpListener() { prefixes = new HttpListenerPrefixCollection(this); registry = new Hashtable(); connections = Hashtable.Synchronized(new Hashtable()); ctx_queue = new ArrayList(); wait_queue = new ArrayList(); auth_schemes = AuthenticationSchemes.Anonymous; defaultServiceNames = new ServiceNameStore(); extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never); }
/// <summary> /// Initializes a new instance of the <see cref="HttpListener"/> class. /// </summary> public HttpListener() { _prefixes = new HttpListenerPrefixCollection(this); _registry = new Hashtable(); _connections = Hashtable.Synchronized(new Hashtable()); _ctxQueue = new ArrayList(); _waitQueue = new ArrayList(); _authSchemes = AuthenticationSchemes.Anonymous; //defaultServiceNames = new ServiceNameStore(); //_extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never); }
public void AddOne() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Start(); coll.Add("http://127.0.0.1:8181/"); Assert.AreEqual(1, coll.Count, "Count"); Assert.IsFalse(coll.IsReadOnly, "IsReadOnly"); Assert.IsFalse(coll.IsSynchronized, "IsSynchronized"); listener.Stop(); }
public void PercentSign() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; // this one throws on Start(), not when adding it. // See same test name in HttpListenerTest. coll.Add("http://localhost:7777/hola%3E/"); string [] strs = new string [1]; coll.CopyTo(strs, 0); Assert.AreEqual("http://localhost:7777/hola%3E/", strs [0]); }
public HttpListener() { _state = State.Stopped; _internalLock = new object(); _defaultServiceNames = new ServiceNameStore(); _timeoutManager = new HttpListenerTimeoutManager(this); _prefixes = new HttpListenerPrefixCollection(this); // default: no CBT checks on any platform (appcompat reasons); applies also to PolicyEnforcement // config element _extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never); }
public void AddOne() { var port = NetworkHelpers.FindFreePort(); HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Start(); coll.Add($"http://127.0.0.1:{port}/"); Assert.AreEqual(1, coll.Count, "Count"); Assert.IsFalse(coll.IsReadOnly, "IsReadOnly"); Assert.IsFalse(coll.IsSynchronized, "IsSynchronized"); listener.Stop(); }
public void Disposed6() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; listener.Close(); string a = null; foreach (string s in coll) { a = s; // just to make the compiler happy } Assert.IsNull(a); }
public void Disposed7() { HttpListener listener = new HttpListener(); HLPC coll = listener.Prefixes; coll.Add("http://127.0.0.1/"); listener.Close(); int items = 0; foreach (string s in coll) { items++; Assert.AreEqual(s, "http://127.0.0.1/"); } Assert.AreEqual(items, 1); }