12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

事 件 监 听 器module EventQueue {// 连 接 事 件 类 型enum EventType {UNDEFINED, CONN_EVENT_TYPE};// 点 ( 客 户 ) 连 接 信 息struct ConnInfo {string ipaddress; // in %d.%d.%d.%d formatlong port;long connID;};// 所 有 类 型 的 事 件 监 听 器 的 标 记 接 口local interface EventListener {};typedef sequence EventListeners;// 连 接 事 件 监 听 器 接 口local interface ConnEventListener :EventListener{void conn_established(in ConnInfo info);void conn_closed(in ConnInfo info);};// EventQueue 管 理 器local interface EventQueueManager :interceptor::InterceptorManager {void register_listener(in EventListener listener, in EventType type);void unregister_listener(in EventListener listener, in EventType type);EventListeners get_listeners(in EventType type);};};接 口 定 义 的 详 情 将 在 后 续 章 节 中 描 述 。ConnInfo 结 构ConnInfo 结 构 包 含 如 下 的 客 户 连 接 信 息 :● ipaddress: 存 储 客 户 IP 地 址 。● port: 存 储 客 户 端 口 号 。● connID: 存 储 服 务 器 分 配 给 每 个 客 户 连 接 的 唯 一 标 识 。EventListener 接 口EventListener 接 口 部 分 是 所 有 类 型 的 监 听 器 的 标 记 接 口 。ConnEventListeners 接 口ConnEventListeners 接 口 定 义 如 下 两 个 操 作 :● void conn_established (in ConnInfo info)本 操 作 由 <strong>VisiBroker</strong> ORB 回 调 以 推 动 连 接 建 立 事 件 。 <strong>VisiBroker</strong> ORB 将 客户 连 接 信 息 填 入 ConnInfo 信 息 参 数 , 并 将 该 值 传 入 回 调 操 作 。● void conn_closed (in ConnInfo info)23-2 <strong>VisiBroker</strong> 开 发 者 指 南

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!