Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
使用消息选择程序,将消息监听器类设置为异步接收 QAnywhere 消息。
public virtual void setMessageListenerBySelector( qa_const_string address, qa_const_string selector, QAMessageListener * listener )
address 监听器将应用到的目标地址。
selector 用于过滤要接收的消息的选择程序。
listener 与目标地址相关联的消息监听器。
监听器是实现 QAMessageListener::onMessage(在 QAMessageListener 接口中定义的唯一方法)的类的一个实例。QAMessageListener::onMessage 接受一个单独的 QAMessage 参数。
setMessageListener address 参数指定用于接收消息的本地队列名称。只能向给定队列指派一个监听器。selector 参数指定用于过滤在给定地址上接收的消息的选择程序。
如果想要监听 QAnywhere 系统消息(包括推式通知和网络状态更改),请指定 "system" 作为队列名称。使用此方法异步接收消息。
有关详细信息,请参见异步接收消息和系统队列。