/// <summary> /// Add a protocol that is supported by the swarm. /// </summary> /// <param name="protocol"> /// The protocol to add. /// </param> public void AddProtocol(IPeerProtocol protocol) { lock (protocols) { protocols.Add(protocol); } }
/// <summary> /// Remove a protocol from the swarm. /// </summary> /// <param name="protocol"> /// The protocol to remove. /// </param> public void RemoveProtocol(IPeerProtocol protocol) { lock (protocols) { protocols.Remove(protocol); } }
/// <summary> /// Add a protocol that the connection will handle. /// </summary> /// <param name="protocol"> /// A peer protocol to add. /// </param> public void AddProtocol(IPeerProtocol protocol) { Protocols.Add(protocol.ToString(), protocol.ProcessMessageAsync); }