Specifies the basic methods and properties of a Listener object. This is an abstract class and must be inherited.
The Listener class provides an abstract base class that represents a listening socket of the proxy server. Descendant classes further specify the protocol that is used between those two connections.
Inheritance: IDisposable
Beispiel #1
0
 public void AddListener(Listener newItem)
 {
     AddListener(Guid.NewGuid(), newItem);
 }
Beispiel #2
0
 private void AddListener(Guid id, Listener newItem)
 {
     if (newItem == null)
         throw new ArgumentNullException();
     listeners[id] = newItem;
     OnListenerStarted(new ListenerEventArgs {Listener = newItem});
     newItem.Start();
 }
Beispiel #3
0
 /// <summary>
 /// Adds a listener to the Listeners list.
 /// </summary>
 /// <param name="newItem">The new Listener to add.</param>
 public void AddListener(Listener newItem)
 {
     if (newItem == null)
         throw new ArgumentNullException();
     ListenEntry le = new ListenEntry();
     le.listener = newItem;
     le.guid = Guid.NewGuid();
     while (Listeners.Contains(le))
     {
         le.guid = Guid.NewGuid();
     }
     Listeners.Add(le);
     Console.WriteLine(newItem.ToString() + " started.");
 }