示例#1
0
        /// <summary>
        /// Receives a message as part of a conversation.
        /// </summary>
        ///
        /// <param name="messageRef">
        /// A typed buffer allocated using <see cref="ATMI.tpalloc"/>.
        /// Gets updated with a typed buffer containing the message received
        /// a part of the conversation.
        /// </param>
        ///
        /// <param name="lenOut">
        /// Gets updated with the length of the data in <paramref name="messageRef"/>.
        /// If the length is 0 then a null message was received.
        /// </param>
        ///
        /// <param name="flags">
        /// See the Tuxedo tprecv(3c) manual page.
        /// </param>
        ///
        /// <exception cref="DotTux.Atmi.TPEV_SENDONLY">
        /// The other end of the connection has given up control of the conversation.
        /// </exception>
        ///
        /// <exception cref="DotTux.Atmi.TPEV_SVCSUCC">
        /// The service routine returned successfully.
        /// In this case, <paramref name="messageRef"/> and <paramref name="lenOut"/>
        /// are updated as described above.
        /// </exception>
        ///
        /// <exception cref="DotTux.Atmi.TPEV_SVCFAIL">
        /// The service routine returned with an application level service failure.
        /// In this case, <paramref name="messageRef"/> and <paramref name="lenOut"/>
        /// are updated as described above.
        /// </exception>
        ///
        /// <exception cref="TPException">
        /// See the Tuxedo tprecv(3c) manual page.
        /// </exception>
        ///
        /// <seealso cref="ATMI.tprecv"/>

        public void Receive(ref ByteBuffer messageRef, out int lenOut, int flags)
        {
            try {
                ATMI.tprecv(cd, ref messageRef, out lenOut, flags);
            } catch (TPEV_SENDONLY eSendOnly) {
                throw eSendOnly;
            } catch (TPEEVENT eEvent) {
                cd = -1;
                throw eEvent;
            }
        }