//--------------------------------------------------------------------- #endregion // DirectPlay Voice Event Handlers #region DirectPlay Event Handlers //--------------------------------------------------------------------- /// <summary> /// Event handler for the DirectPlay FindHostResponse message /// </summary> public void FindHostResponseHandler(object sender, FindHostResponseEventArgs args) { HostInfo Node = new HostInfo(); Node.GuidInstance = args.Message.ApplicationDescription.GuidInstance; Node.HostAddress = (Address)args.Message.AddressSender.Clone(); Node.SessionName = args.Message.ApplicationDescription.SessionName; // If he haven't already seen this host, add the detected session // to the stored list if (!FoundSessions.Contains(Node)) { FoundSessions.Add(Node); } }
private void OnFindHost(object sender, FindHostResponseEventArgs e) { lock (this) { // Do nothing if we're connected already if (connected) { } else { connected = true; // Connect to the first one ((Client)sender).Connect(e.Message.ApplicationDescription, e.Message.AddressSender, e.Message.AddressDevice, null, ConnectFlags.OkToQueryForAddressing); } } }
/// <summary> /// A host was found and responded to our query /// </summary> private void FindHostResponseMessage(object sender, FindHostResponseEventArgs dpMessage) { // Now we need to add this to our list of available sessions SessionAdd(dpMessage.Message); }
/// <summary> /// A host was found and responded to our query /// </summary> private void FindHostResponseMessage(object sender, FindHostResponseEventArgs dpMessage) { // Now we need to add this to our list of available sessions SessionAdd(dpMessage.Message); }