/// <summary> /// Send an IQ Request and store the object with callback in the Hashtable /// </summary> /// <param name="iq">The iq to send</param> /// <param name="callback">the callback function which gets raised for the response</param> /// <param name="data">additional object for arguments</param> public void SendIq(IQ iq, IqGrabberCallback callback, object data) { if (callback != null) { var info = new IqGrabberInfo { Callback = callback, UserData = data }; this.Queue.AddOrUpdate(iq.Id, info, (key, old) => info); } this.Connection.Send(iq); }
/// <summary> /// Send an IQ Request and store the object with callback in the Hashtable /// </summary> /// <param name="iq">The iq to send</param> /// <param name="callback">the callback function which gets raised for the response</param> public void SendIq(IQ iq, IqGrabberCallback callback) { this.SendIq(iq, callback, null); }