/// <summary> /// The default constructor used to wrap a native broadcast implementation. /// </summary> /// <param name="nativeBroadcast"></param> /// <param name="networkBroadcast"></param> internal NetworkRelayBroadcast(IXDBroadcast nativeBroadcast, IXDBroadcast networkBroadcast) { if (nativeBroadcast == null) { throw new ArgumentNullException("nativeBroadcast"); } if (networkBroadcast == null) { throw new ArgumentNullException("networkBroadcast"); } if (nativeBroadcast.GetType() == typeof(XDMailSlotBroadcast)) { throw new ArgumentException("Cannot be of type XDMailSlotBroadcast.", "nativeBroadcast"); } this.mailSlotName = GetPropagateNetworkMailSlotName(nativeBroadcast); // the native broadcast that this implementation wrappers this.nativeBroadcast = nativeBroadcast; // the MailSlot broadcast implementation is used to send over the network this.networkBroadcast = networkBroadcast; }
/// <summary> /// Gets the unique network propagation MailSlot name. /// </summary> /// <param name="nativeBroadcast"></param> /// <returns></returns> internal static string GetPropagateNetworkMailSlotName(IXDBroadcast nativeBroadcast) { // each mode has a unique MailSlot ident for monitoring network traffic return string.Concat(NetworkPropagateChannel, ".", nativeBroadcast.GetType().Name); }
/// <summary> /// Gets the unique network propagation MailSlot name. /// </summary> /// <param name="nativeBroadcast"></param> /// <returns></returns> internal static string GetPropagateNetworkMailSlotName(IXDBroadcast nativeBroadcast) { // each mode has a unique MailSlot ident for monitoring network traffic return(string.Concat(NetworkPropagateChannel, ".", nativeBroadcast.GetType().Name)); }