op_ev_dst_id()

摘要

获取事件目标模块的对象 ID。

语法

op_ev_dst_id (evhandle)
参数 类型 说明
evhandle Evhandle 标识该事件的事件句柄
[事件句柄可以从本包中的多个内核过程获取,例如 op_ev_current()、op_ev_seek_time() 和 op_ev_next(),以及 op_intrpt_schedule_self() 等其他内核过程。]

返回类型

Objid

作为指定事件目标的模块的对象 ID。

发生可恢复错误时返回符号常量 OPC_OBJID_INVALID。

示例

/* Find the first event for the receiver after */
/* 5.0 seconds from the current time and cancel it. */
time = op_sim_time () + 5.0;
event = op_ev_seek_time (time, OPC_EVSEEK_TIME_POST);
while (op_ev_valid (event))
	{
	if (op_ev_dst_id (event) == recv_id)
		{
		op_ev_cancel (event);
		break;
		}
	else
		event = op_ev_next (event);
	}

详情

该内核过程对所有事件类型均有效,组播中断除外,因为这类中断没有单一的目标模块。

用途

提供了一种确定事件将在哪个对象处递送的机制。

错误

  • 程序中止:段错误。(由于格式错误的事件句柄)
  • 可恢复错误:事件句柄指向的事件无效或当前未被计划。
  • 可恢复错误:该事件是组播中断,因此没有单一的目标对象。
  • 可恢复错误:事件没有目标对象。(即不属于任何特定模块)

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com