test.idl

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· IDL 代码 · 共 84 行

IDL
84
字号
//
// Test.idl,v 1.4 2001/04/24 08:02:57 coryan Exp
//

module Test
{
  /// The message type, just used to send a lot of data on each
  /// request
  typedef sequence<octet> Payload;

  /// A session is a single instance of the test
  interface Session;
  typedef sequence<Session> Session_List;

  /// A session control is used to determine if all the Session in an
  /// experiment have finished.
  /**
   * @param success If false then the session failed, the experiment
   *        is successful only if all sessions finish successfully
   */
  interface Session_Control
  {
    void session_finished (in boolean success);
  };

  /// A Peer is used to create sessions
  interface Peer
  {
    /// Create a new session
    /**
     * @param payload_size The size of each message
     * @param thread_count The number of threads that each session
     *        must create
     * @param message_count How many messages does each thread send.
     */
    Session create_session (in Session_Control control,
                            in unsigned long payload_size,
                            in unsigned long thread_count,
                            in unsigned long message_count,
                            in unsigned long peer_count);

    /// Shutdown the peer
    oneway void shutdown ();
  };

  /// The Session already has an experiment running.
  exception Already_Running {};

  /// The experiment requires at least two Sessions
  exception No_Peers {};

  interface Session
  {
    /// Start the test, send messages to all the peers
    /**
     * @param other_sessions The list of sessions participating in the
     *        experiment, this list must not include the session
     *        receiving the start() call.
     */
    void start (in Session_List other_sessions)
      raises (Already_Running, No_Peers);

    /// Ping the session, used to validate all connections
    void ping ();

    /// Receive the payload
    oneway void receive_payload (in Payload the_payload);

    /// Destroy the Session object
    void destroy ();
  };

  interface Coordinator
  {
    /// Add a new peer.
    /**
     * The coordinator starts the test by calling <send_oneways> on
     * all peers. How does it decide to do that is application
     * specific.
     */
    void add_peer (in Peer the_peer);
  };
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?