Beispiel #1
0
 /// <summary>
 /// Creates a new channel associated with the specified name and the specified <see cref="IMethodCodec"/>
 /// and the specified <see cref="IBinaryMessenger"/>.
 /// </summary>
 /// <param name="name">A channel name string.</param>
 /// <param name="codec">A <see cref="IMethodCodec"/>.</param>
 /// <param name="messenger">A <see cref="IBinaryMessenger"/>.</param>
 public MethodChannel(string name, IMethodCodec codec, IBinaryMessenger messenger)
 {
     if (string.IsNullOrEmpty(name))
     {
         throw new ArgumentException("name cannot be null or empty");
     }
     Name            = name;
     Codec           = codec ?? throw new ArgumentNullException(nameof(codec));
     BinaryMessenger = messenger ?? throw new ArgumentNullException(nameof(messenger));
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new channel associated with the specified name and the specified <see cref="IMethodCodec"/>
 /// and the default <see cref="IBinaryMessenger"/>.
 /// </summary>
 /// <param name="name">A channel name string.</param>
 /// <param name="codec">A <see cref="IMethodCodec"/>.</param>
 public MethodChannel(string name, IMethodCodec codec)
     : this(name, codec, DefaultBinaryMessenger.Instance)
 {
 }