コード例 #1
0
ファイル: Swarm.cs プロジェクト: hanabi1224/peer-talk
 /// <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);
     }
 }
コード例 #2
0
ファイル: Swarm.cs プロジェクト: hanabi1224/peer-talk
 /// <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);
     }
 }
コード例 #3
0
 /// <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);
 }